input: from typing import List
  
  def calculate_max_reward(rewardList: List[int]) -> int:
      """
      Given an integer array rewardList with a length of n, representing the reward values.
  
      Initially, your accumulated reward x is 0, and no indices are marked. You can repeatedly perform the following operation:
  
      Select an unmarked index i from the range of [0, n - 1].
      If rewardList[i] exceeds your current accumulated reward x, then add rewardList[i] to x (i.e., x = x + rewardList[i]), and mark the selected index i.
  
      Return an integer indicating the highest possible total reward you can gather by optimally performing the operations.
  
      Examples:
      >>> rewardList = [1,1,3,3]
      4
      >>> rewardList = [1,6,4,3,2]
      11
  
      Constraints:
      1 <= rewardList.length <= 2000
      1 <= rewardList[i] <= 2000
      """
output:     rewardList.sort()
      total_reward = 0
      for reward in rewardList:
          if reward > total_reward:
              total_reward += reward
      return total_reward