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.
fast and simple.
find the max price, split the array before and after max price, buy all stocks before max price and then sell them at max price; repeat above procedure on the array after max element.
Thats it!
Stock Maximize
You are viewing a single comment's thread. Return to all comments →
fast and simple. find the max price, split the array before and after max price, buy all stocks before max price and then sell them at max price; repeat above procedure on the array after max element. Thats it!