Given a list of historic stock prices, what is the best time to buy and sell to maximize profit?
Implement max_profit(prices). Return [buy_index, sell_index, profit] for one profitable transaction, or [-1, -1, 0] when no profit is possible. Buy and sell must occur on different days.
def max_profit(prices):