Tap here to switch tabs
Problem
Submissions

Problem: Reach End of Array With Max Score

Reach End of Array With Max Score asks you to choose forward jumps from index zero to the last index, earning the jump length times the value at each starting index, and return the maximum total.

Statement

You are given an integer array nums.

You start at index 00. In each step, if you are at index ii, you can jump to any index jj such that i<j<i < j < nums.length. The score gained from this jump is (j−i)imes(j - i) imes nums[i][i].

Return the maximum total score possible to reach the last index (nums.length −1- 1).

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Reach End of Array With Max Score

Reach End of Array With Max Score asks you to choose forward jumps from index zero to the last index, earning the jump length times the value at each starting index, and return the maximum total.

Statement

You are given an integer array nums.

You start at index 00. In each step, if you are at index ii, you can jump to any index jj such that i<j<i < j < nums.length. The score gained from this jump is (j−i)imes(j - i) imes nums[i][i].

Return the maximum total score possible to reach the last index (nums.length −1- 1).

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 1≤1 \leq nums[i] ≤105\leq 10^5