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.
I really didnt think this solution would work but it does. Can't quite understand how adding on to the total how many times you have seen the anagram does the same thing as nCr where n and r are total times seen and r is 2 for the pairs
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 →
I really didnt think this solution would work but it does. Can't quite understand how adding on to the total how many times you have seen the anagram does the same thing as nCr where n and r are total times seen and r is 2 for the pairs