Making Anagrams Hackerrank Solution