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.
Genius. I didn't thing about sorting a char arrray. I was trying to build a new hash function to map all anagrams to the same Integer location and then do an nC2 on the count of all substrings. (n*(n-1)/2)
Thanks for the way easier solution.
Cookie support is required to access HackerRank
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 →
Genius. I didn't thing about sorting a char arrray. I was trying to build a new hash function to map all anagrams to the same Integer location and then do an nC2 on the count of all substrings. (n*(n-1)/2) Thanks for the way easier solution.