2056. Jump Game VIII

Medium
Array
Dynamic Programming
Stack
Graph
Monotonic Stack
Shortest Path

Description

Hints

Hint 1
For each index, find the indexes that you can jump to.
Hint 2
We can do this by using a monotonic stack and iterating through the array backwards.
Hint 3
Create another integer array of length n called dp where dp[i] is the minimum cost of getting to index i.

Statistics

Acceptance
45.4%
Submissions
17,124
Accepted
7,770