在Hackerrank中添加依赖项

huangapple go评论72阅读模式
英文:

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!

huangapple
  • 本文由 发表于 2023年2月18日 16:15:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/75492044.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定