You are viewing a single comment's thread. Return to all comments →
def stockmax(prices): profit = 0 maxPrice = 0 for price in prices[::-1]: if price > maxPrice: maxPrice = price else: profit += maxPrice - price return profit
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 →