A First Citizens BancShares market-monitoring component receives daily closing prices for a stock. Given the prices in chronological order, determine the maximum profit possible from exactly one purchase and one sale.
You must buy on one day and sell on a later day. If no profitable transaction is possible, return 0. Do not reorder the prices or perform multiple transactions.
Implement max_profit(prices).
prices, a list of integers where prices[i] is the stock's closing price on day i.sell_price - buy_price.buy_day < sell_day.def max_profit(prices):