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.
This problem is definitely easier than a fair number of the medium-rated DP problems. At least in this case it's obvious how to relate the desired solution to the solution to a smaller version of the problem. Sure, you need to figure out how to condense some of the sub-problems together so you can handle large P without running out of time or memory, but that's a much more straightforward problem.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
P-sequences
You are viewing a single comment's thread. Return to all comments →
This problem is definitely easier than a fair number of the medium-rated DP problems. At least in this case it's obvious how to relate the desired solution to the solution to a smaller version of the problem. Sure, you need to figure out how to condense some of the sub-problems together so you can handle large P without running out of time or memory, but that's a much more straightforward problem.