HackerRank Strings : Making Anagrams Explained - Java