Best Time to Buy and Sell Stock I: given prices[i], choose one buy day and a later sell day to maximize profit; return 0 if no profit (e.g. [7,1,5,3,6,4] -> 5).
Asked in the Round 1 stage.
Implement max_profit(prices).
prices is a list of integers, where prices[i] is the stock price on day i. Return an integer representing the maximum profit from exactly one buy followed by one later sell, or 0 when no profitable transaction exists.
def max_profit(prices):