input: from typing import List
  
  def find_max_reward(rewardPoints: List[int]) -> int:
      """
      You have a list rewardPoints of length n that represents reward values.
  
      Initially, your total reward is zero, and all indices are unmarked. You can perform the following operation as many times as you wish:
  
      Select an unmarked index i from the range [0, n - 1].
      If rewardPoints[i] is greater than your current total reward, then add rewardPoints[i] to your total reward (i.e., total_reward = total_reward + rewardPoints[i]), and mark the index i.
  
      Return an integer representing the maximum total reward you can gather by optimally performing the operations.
  
      Examples:
      >>> rewardPoints = [1,1,3,3]
      4
      >>> rewardPoints = [1,6,4,3,2]
      11
  
      Constraints:
      1 <= rewardPoints.length <= 2000
      1 <= rewardPoints[i] <= 2000
      """
output:     total_reward = 0
      rewardPoints.sort(reverse=True)
      for reward in rewardPoints:
          if reward > total_reward:
              total_reward += reward
      return total_reward