3971. Maximum Total Value
LeetCodeOpen on judge ↗
You are given two integer arrays value and decay, and an integer m. - value[i] represents the initial value at index i. - decay[i] represents how much the value decreases after each selection of index i. You may select any index multiple times. The total number of selections across all indices must not exceed m. If you select index i for the tth time, where t is 1-indexed, the value gained is
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start