input: Write a Python function that accepts an integer array `rewardValues` of length n, representing the values of rewards.
  
  Initially, your total reward `x` is zero, and all indices are unmarked. You can perform the following operation multiple times:
  
  Choose an unmarked index `i` from the range `[0, n - 1]`.
  If `rewardValues[i]` is greater than your current total reward `x`, then add `rewardValues[i]` to `x` (i.e., `x = x + rewardValues[i]`), and mark the index `i`.
  
  Return an integer representing the maximum total reward you can achieve by executing the operations optimally.
  
  Examples:
  >>> rewardValues = [1,1,3,3]
  4
  >>> rewardValues = [1,6,4,3,2]
  11
  
  Constraints:
  1 <= rewardValues.length <= 2000
  1 <= rewardValues[i] <= 2000
output: def maxReward(rewardValues):
      rewardValues.sort()
      x = 0
      for reward in rewardValues:
          if reward > x:
              x += reward
      return x