You are viewing a single comment's thread. Return to all comments →
Yes, you can use a hashmap to get a solution that runs in O(N^2). You just have to do some little tricks in order to efficiently get hashcodes for the count arrays. https://www.hackerrank.com/challenges/sherlock-and-anagrams/submissions/code/23455764
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Anagrams
You are viewing a single comment's thread. Return to all comments →
Yes, you can use a hashmap to get a solution that runs in O(N^2). You just have to do some little tricks in order to efficiently get hashcodes for the count arrays. https://www.hackerrank.com/challenges/sherlock-and-anagrams/submissions/code/23455764