• + 2 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.