input: from typing import List
  
  def max_revenue(prices: List[int]) -> int:
      """
      Calculate the maximum revenue that can be obtained from a given list of prices.
      The maximum revenue is defined as the highest possible gain from buying and selling
      the item on different days.
  
      >>> max_revenue([10, 7, 5, 8, 11, 9])
      6
      >>> max_revenue([5, 4, 3, 2, 1])
      0
      """
output:     if not prices:
          return 0
  
      min_price = prices[0]
      max_gain = 0
  
      for price in prices:
          min_price = min(min_price, price)
          max_gain = max(max_gain, price - min_price)
  
      return max_gain