英文:
Adding dependencies in Hackerrank
问题
我在 Hackerrank 上解决了一个问题,需要调用一个返回 Json 的 API,然后将其映射为对象。我尝试使用了像 Gson 和 ObjectMapper 这样的库来解决这个问题,但即使在导入部分添加了 gson 和 ObjectMapper 库,Hackerrank IDE 仍然无法解析它们。是否有办法在 Hackerrank IDE 中添加依赖项并成功提交代码?
英文:
I was solving a question on Hackerrank where I had to hit an API which was returning Json, then I had to map into Object. I had used Libraries like Gson and ObjectMapper to solve the question but the Hackerank IDE was not able to resolve Gson and ObjectMapper libraries even after adding gson and Object mapper libraries in import section. Is there any way to add dependencies in Hackerrank IDE and successfully submit it?
答案1
得分: 1
根据HackerRank环境文档,以下库可用:
TestNG, JSON Simple, Tagsoup, Google/Gson, HTTPCore, HTTPClient, XMLResolver, Jing, JUnit, Hamcrest, Commons Lang3, Commons Logging.
来源:https://support.hackerrank.com/hc/en-us/articles/1500002392722-Execution-Environment。(点击“编码和数据库”,滚动到Java信息...)
英文:
According to the HackerRank Environment documentation, the following libraries are available:
TestNG, JSON Simple, Tagsoup, Google/Gson, HTTPCore, HTTPClient, XMLResolver, Jing, JUnit, Hamcrest, Commons Lang3, Commons Logging.
Source: https://support.hackerrank.com/hc/en-us/articles/1500002392722-Execution-Environment. (Click on "Coding and Database" and scroll to the Java information ...)
答案2
得分: 0
不允许在这些挑战中使用库或框架。目的是检查你如何解决问题,而不是一个库的开发者。这就是为什么这些课程如此具有挑战性。回到根本:只使用Java API本身来通过!
英文:
Well, you are not allowed to use libraries or frameworks in these challenges. The idea is to check how you would solve the problem, not the developer of a library. That's why these lessons are so challenging. Back to the roots: Use just the Java API itself to pass!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论