String Function Calculation

  • + 0 comments

    Just combine lcp with largest-rectangle-in-histogram and this exercise is solvable in 10 minutes.

    C++ code is a bit too long to post here, but if anyone is interested, I posted a solution in my github repo with a nice list of tests if you want to use them.

    By the way, once you solve it you can see the code in the Editorial area. It is dreadful, hackerrank should clean up code from almost 10 years ago that is C with classes mostly.