Java Anagrams

  • + 6 comments

    For those of you who are trying to create a HashMap but can't because you can't import it, you can still create a HashMap by declaring the package. Here's the code below.

    java.util.HashMap<Character, Integer> hm = new java.util.HashMap<>()
    
    • + 1 comment

      Thank you so much kzhang9101

      I coded my solution in repl.it and there was no way to port it to Hackerrank because of the import problem. I was starting to go crazy because I saw solutions using HashMaps and even Arrays without using the imports.

      Thank you very very much!! :D

      • + 0 comments

        Thank you so much , i needed that line

    • + 0 comments

      Thank you so much!

    • + 1 comment

      i had solution working in eclipse. however due to hackerrank not allowing import statement to edit, program was giving compilation error. Thank you ! learn new way.

      • + 1 comment

        Import is not working in some cases becoz the question restrict us to use some predefined functions and Arrays.sort() is one of them.

        • + 0 comments

          Here is the answer of java anagrams problem: Java Anagrams Solution

    • + 0 comments

      thank u sm!

    • + 0 comments

      Thanks a lot. I saved a lot of time.

    • + 0 comments

      This is gold