You are viewing a single comment's thread. Return to all comments →
def stockmax(prices): res = 0 while prices: max_price = max(prices) idx_max = prices.index(max_price) cur_pft = sum([max_price - p for p in prices[:idx_max]]) res += cur_pft prices = prices[idx_max+1:] return res
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 →