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 have yet to start writing code on this, but I'm thinking that it might be good to build a suffix array augmented with LCP array. I know that they can be used to quickly count the number of distinct substrings of a given string. But I'm still strugling to figure out how to deal with multiple queries, quickly counting substrings of a substring?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
How Many Substrings?
You are viewing a single comment's thread. Return to all comments →
I have yet to start writing code on this, but I'm thinking that it might be good to build a suffix array augmented with LCP array. I know that they can be used to quickly count the number of distinct substrings of a given string. But I'm still strugling to figure out how to deal with multiple queries, quickly counting substrings of a substring?