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.
yes they are if there is a substring(or the stirng itself) abca,so u make a substring abc and add it to the hashmap and then at some point ur going to make a substring bca which is an anagram of abc.
I personally couldn't understand the: totalCount=totalCount+value;
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 →
yes they are if there is a substring(or the stirng itself) abca,so u make a substring abc and add it to the hashmap and then at some point ur going to make a substring bca which is an anagram of abc. I personally couldn't understand the: totalCount=totalCount+value;