Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
accumulate(min) solution in Clear category for Stock Profit by StefanPochmann
from itertools import accumulate
from operator import sub
def stock_profit(stock: list) -> int:
return max(map(sub, stock, accumulate(stock, min)))
Nov. 18, 2021