input: def max_revenue(prices: List[int]) -> int:
      """Calculate the maximum revenue that can be obtained by buying and selling stocks based on given prices at different times.
      The function calculates the difference between consecutive prices and then finds the maximum sum of these differences.
      
      >>> max_revenue([10, 7, 5, 8, 11, 9])
      6
      """
output:     max_profit = 0
      current_profit = 0
      
      for i in range(1, len(prices)):
          price_diff = prices[i] - prices[i - 1]
          current_profit = max(0, current_profit + price_diff)
          max_profit = max(max_profit, current_profit)
      
      return max_profit