input: from typing import List
  
  def max_revenue(prices: List[int]) -> int:
      """ Calculate the maximum revenue that can be obtained by buying and selling the stock
      based on the given list of prices. The revenue is calculated by finding the maximum
      positive difference between the prices of subsequent days.
      >>> max_revenue([10, 7, 5, 8, 11, 9])
      6
      """
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