You are viewing a single comment's thread. Return to all comments →
def stockmax(prices): last_price = prices[-1] max_profit = 0 for key, price in enumerate(reversed(prices)): if not key: continue if price < last_price: max_profit += last_price - price else: last_price = price return max_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 →