55. Jump Game

Medium — Greedy / Dynamic Programming

Greedy (Optimal)
Bottom-Up DP
Press "Play" or "Step" to walk through the algorithm.

Step

0 / 0

Index i

--

Farthest / lastGood

--

Result

--
Current i
Already reachable
Target / good
Stuck / unreachable
Algorithm Complexity (smaller bar = faster)
Backtracking
O(2ⁿ)
Time / Space: O(2ⁿ) / O(n)
Top-Down DP
O(n²)
Time / Space: O(n²) / O(n)
Bottom-Up DP
O(n)
Time / Space: O(n) / O(1)
Greedy
O(n)
Time / Space: O(n) / O(1)