You are given an integer array rewardValues of size
Initially, your total reward x is
Pick an unmarked index i from rewardValues[i] > x.
Add rewardValues[i] to your current total reward x (i.e., x = x + rewardValues[i]).
Mark the index i.
Return the maximum total reward x you can achieve by performing the operations optimally.
Constraints:
rewardValues.length
rewardValues[i]
You are given an integer array rewardValues of size
Initially, your total reward x is
Pick an unmarked index i from rewardValues[i] > x.
Add rewardValues[i] to your current total reward x (i.e., x = x + rewardValues[i]).
Mark the index i.
Return the maximum total reward x you can achieve by performing the operations optimally.
Constraints:
rewardValues.length
rewardValues[i]