You are given an integer array rewardValues, representing the values of rewards.
Initially, your total reward x is
Choose an unmarked index i such that rewardValues[i] is strictly greater than your current total reward x.
Add rewardValues[i] to x and mark the index i.
Return the maximum total reward you can collect by performing these operations optimally.
Constraints:
rewardValues.length
rewardValues[i]
You are given an integer array rewardValues, representing the values of rewards.
Initially, your total reward x is
Choose an unmarked index i such that rewardValues[i] is strictly greater than your current total reward x.
Add rewardValues[i] to x and mark the index i.
Return the maximum total reward you can collect by performing these operations optimally.
Constraints:
rewardValues.length
rewardValues[i]