LeetCode 55 ·
Medium
Jump Game
Each value is a max jump length; return whether the last index is reachable.
Try it
Step through the core mechanic. The simulator below runs the greedy shape this problem is built on.
Walk the pattern
No dedicated step-through for this one yet. The shape is Greedy — its pattern page has the interactive walkthrough, the reference implementation, and a five-problem progression that this problem sits inside.
The approach
Track the farthest index reachable so far. If the current index ever exceeds that reach, you are stuck. If reach hits the last index, success. One greedy pass.
| Aspect | Value |
|---|---|
| Pattern | Greedy |
| Recognise it by | Can you reach the last index? |
| Time complexity | O(n) |
| Space complexity | O(1) |
| Difficulty | Medium |
Who asks it
Companies known to ask this problem, from public LeetCode company-tag aggregations. A signal of where to expect it, not a guarantee.