Pattern Recognition Drill
Medium Greedy
The Problem
Given array where each element is max jump length, find minimum jumps to reach the last index.
What approach would you use?
Think about it before scrolling down.
Track current jump boundary and farthest reach. When hitting boundary, jump++, extend boundary. O(n).
dp[i] = min jumps to reach i. O(n²) — much slower.
Common Trap
Don't BFS with a queue — the greedy two-pointer approach is O(n) with O(1) space.