input: from typing import List
  
  def max_revenue(prices: List[int]) -> int:
      """ Calculate the maximum revenue by finding the maximum difference
      between any two prices, where the second price is higher than the first price.
      >>> max_revenue([10, 7, 5, 8, 11, 9])
      6
      >>> max_revenue([1, 6, 3, 4, 5])
      4
      """
output:     max_diff = 0
      min_price = prices[0]
      
      for price in prices:
          if price < min_price:
              min_price = price
          else:
              max_diff = max(max_diff, price - min_price)
      
      return max_diff