Tell me about your approach to solving the Best Time to Buy and Sell Stock problem.
Implement max_profit(prices), where prices is a list of daily stock prices. Choose one day to buy and a later day to sell, or make no transaction, and return the maximum possible profit.
The function should return an integer. The input contains at least one price, and buying and selling on the same day is not allowed.
def max_profit(prices):