input: from typing import List
  
  
  def max_revenue(prices: List[int]) -> int:
      """Calculates the maximum revenue that can be obtained by selecting a 
      contiguous subarray of diurnal prices. The revenue is the sum of the 
      differences between consecutive prices in the subarray.
      >>> max_revenue([10, 7, 5, 8, 11, 9])
      6
      >>> max_revenue([5, 4, 3, 2, 1])
      0
      >>> max_revenue([1, 2, 3, 4, 5])
      4
      """
output:     max_rev = 0
      current_sum = 0
      
      for i in range(1, len(prices)):
          diff = prices[i] - prices[i - 1]
          current_sum = max(diff, current_sum + diff)
          max_rev = max(max_rev, current_sum)
      
      return max_rev