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.
solution via relatively straightforward dynamic programming. weirdly this doesn't fit with the way the problem wants you to compute the values for each query separately - for this you'd have to maintain the value table w/o knowing its final size, which is very awkward - a lot easier to change the input parsing code so that it sends all queries at once so that they can be processed together.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Down to Zero II
You are viewing a single comment's thread. Return to all comments →
solution via relatively straightforward dynamic programming. weirdly this doesn't fit with the way the problem wants you to compute the values for each query separately - for this you'd have to maintain the value table w/o knowing its final size, which is very awkward - a lot easier to change the input parsing code so that it sends all queries at once so that they can be processed together.