You are viewing a single comment's thread. Return to all comments →
Here is a hint on how to make this much easier and optimize the runtime: Go through the prices array backwards.
Second hint: track the maximum price and the current price. Use that to find your profits.
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 →
Here is a hint on how to make this much easier and optimize the runtime: Go through the prices array backwards.
Second hint: track the maximum price and the current price. Use that to find your profits.