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.
Not a DP problem. Solution is just to iterate backwards. If our current price is greater than the max price, update the max price. If it is smaller, then there is profit to be made - and that profit is the difference between the current price and max price (as we would offload all shares on the max price day).
Stock Maximize
You are viewing a single comment's thread. Return to all comments →
Not a DP problem. Solution is just to iterate backwards. If our current price is greater than the max price, update the max price. If it is smaller, then there is profit to be made - and that profit is the difference between the current price and max price (as we would offload all shares on the max price day).