Tap here to switch tabs
Problem
Submissions

Problem: Maximum Array Hopping Score I

med
30 min
Try to solve the Maximum Array Hopping Score I problem.

Statement

You are given an integer array nums.

Starting at index 00, you can jump from your current index i to any index j such that i < j. The score obtained from jumping from index i to index j is (j−i)×(j - i) \times nums[j].

You can perform any number of jumps until you reach the last index of nums.

Return the maximum total score you can achieve.

Constraints:

  • 2≤2 \leq nums.length ≤103\leq 10^3

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Array Hopping Score I

med
30 min
Try to solve the Maximum Array Hopping Score I problem.

Statement

You are given an integer array nums.

Starting at index 00, you can jump from your current index i to any index j such that i < j. The score obtained from jumping from index i to index j is (j−i)×(j - i) \times nums[j].

You can perform any number of jumps until you reach the last index of nums.

Return the maximum total score you can achieve.

Constraints:

  • 2≤2 \leq nums.length ≤103\leq 10^3

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