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.
I was wondering the same. It seems to me that the way the problems are categorized is not quite right. Some pretty hard problems are categorized as easy (see Dortmund Dilemma) and some that are not DP are listed as DP. And yes, there is at least one solution that is a simple linear sweep through the table of prices that computes the maximum profit. I think the only thing that's DP-like about it is that you have to work your way bottom-up to get the value. I wish all problems had high-quality editorials..
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Stock Maximize
You are viewing a single comment's thread. Return to all comments →
I was wondering the same. It seems to me that the way the problems are categorized is not quite right. Some pretty hard problems are categorized as easy (see Dortmund Dilemma) and some that are not DP are listed as DP. And yes, there is at least one solution that is a simple linear sweep through the table of prices that computes the maximum profit. I think the only thing that's DP-like about it is that you have to work your way bottom-up to get the value. I wish all problems had high-quality editorials..