input: Write a function to calculate the maximum revenue from a list of prices by finding the maximum sum of non-contiguous price differences. If the input list is empty, return 0.
  assert max_revenue([10, 7, 5, 8, 11, 9])==6
  assert max_revenue([9, 11, 5, 7, 8, 10])==5
  assert max_revenue([5, 4, 3, 2, 1])==0
  assert max_revenue([1, 2, 3, 4, 5])==4
  assert max_revenue([])==0
output: def max_revenue(prices):
      if not prices:
          return 0
      n = len(prices)
      if n == 1:
          return 0
      dp = [0] * n
      dp[0] = 0
      dp[1] = max(0, prices[1] - prices[0])
      for i in range(2, n):
          dp[i] = max(dp[i-1], dp[i-2] + max(0, prices[i] - prices[i-1]))
      return dp[-1]