Tap here to switch tabs
Problem
Submissions

Problem: Reach End of Array With Max Score

Try to solve the Reach End of Array With Max Score problem.

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

Try to solve the Reach End of Array With Max Score problem.

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