input: from typing import List
  
  def max_revenue(prices: List[int]) -> int:
      """ Calculate the maximum revenue that can be obtained from a list of stock prices.
      The revenue is defined as the difference between the highest and the lowest stock prices
      in any subset of the list.
      >>> max_revenue([10, 7, 5, 8, 11, 9])
      6
      """
output:     min_price = float('inf')
      max_revenue = 0
      
      for price in prices:
          if price < min_price:
              min_price = price
          elif price - min_price > max_revenue:
              max_revenue = price - min_price
      
      return max_revenue