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.
you don't need to actually list all combinations to count how many there are. There is an analytic formula to get that number n(n-1)/2 where n is the window(substring) size.
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 →
you don't need to actually list all combinations to count how many there are. There is an analytic formula to get that number n(n-1)/2 where n is the window(substring) size.