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.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
String Function Calculation
You are viewing a single comment's thread. Return to all 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.