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 a suffix tree class that I've been using to solve many of the String problems, so I thought I'd have a go with that. It yields what I think is a very interesting, multi-pass algorithm whose worst case is O(N * log(N)). Much clunkier than the Editorial, but asymptotically better ;) It's C++14, and the longest it takes to solve any of the testcases is 0.04s.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Build a String
You are viewing a single comment's thread. Return to all comments →
@nikasvanidze always does my favourite problems :)
I have a suffix tree class that I've been using to solve many of the String problems, so I thought I'd have a go with that. It yields what I think is a very interesting, multi-pass algorithm whose worst case is O(N * log(N)). Much clunkier than the Editorial, but asymptotically better ;) It's C++14, and the longest it takes to solve any of the testcases is 0.04s.