You are given two integer arrays value and decay of equal length, along with an integer m.
You can make at most m selections across the available indices. When you choose an index i:
The first time index i is selected, you gain value[i].
Each subsequent time index i is selected, the gained value decreases by decay[i]. If index i has previously been selected value[i] decay[i]
Return the maximum total value you can achieve after at most m selections.
Constraints:
value.length decay.length
value[i], decay[i]
m
You are given two integer arrays value and decay of equal length, along with an integer m.
You can make at most m selections across the available indices. When you choose an index i:
The first time index i is selected, you gain value[i].
Each subsequent time index i is selected, the gained value decreases by decay[i]. If index i has previously been selected value[i] decay[i]
Return the maximum total value you can achieve after at most m selections.
Constraints:
value.length decay.length
value[i], decay[i]
m