Maximum Value-Distance Jump Score
Problem statement
You start at index 0 of an integer array values and must finish at the last index. From index i, jump to any j > i.
A jump scores values[j] * (j-i). Return the maximum total score over a complete path to the final index. Use signed 64-bit arithmetic.
Function
maximumJumpScore(values: int[]) → longExamples
Example 1
values = [3,10,2,12]return = 36Jump directly from index 0 to 3 for 12*3=36.
Example 2
values = [0,5,1]return = 6Jump 0→1 for 5, then 1→2 for 1.
Example 3
values = [7]return = 0No jump is needed.
Constraints
1 <= values.length <= 2000.-10^9 <= values[i] <= 10^9.