We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Interesting... I did it the other way: By checking the number of elements in the dictionary after the 2nd for loop, as opposed to counting the number of elements in the 2nd string that the dictionary does not contain.
Also, I tried to experiment with a 1 loop solution, ie: count the total number of characters in the entire string, and count the number of odd occurences and divide that by 2. But that does not seem to work :(
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Anagram
You are viewing a single comment's thread. Return to all comments →
Interesting... I did it the other way: By checking the number of elements in the dictionary after the 2nd for loop, as opposed to counting the number of elements in the 2nd string that the dictionary does not contain.
Also, I tried to experiment with a 1 loop solution, ie: count the total number of characters in the entire string, and count the number of odd occurences and divide that by 2. But that does not seem to work :(