Ezvor

3205. Maximum Array Hopping Score I

MediumArray Preparing judge… LeetCode
ArrayDynamic ProgrammingStackGreedyMonotonic Stack

Hints

Hint 1
Define dp[i] as the maximum score if we start from index i.
Hint 2
We can calculate dp[i] as the maximum score from hopping to all indices j > i.