input: Write a python function to find the maximum profit from stock prices.
  assert max_profit([7, 1, 5, 3, 6, 4]) == 5
  assert max_profit([7, 6, 4, 3, 1]) == 0
  assert max_profit([1, 2, 3, 4, 5]) == 4
output: def max_profit(prices):
      if not prices:
          return 0
  
      min_price = prices[0]
      max_profit = 0
  
      for price in prices:
          if price < min_price:
              min_price = price
          elif price - min_price > max_profit:
              max_profit = price - min_price
  
      return max_profit