Greedy Algorithms8 sections · 316 units
Open in Course

Problem - Jump Game II

Minimum jumps

Same setup, but find the minimum number of jumps to reach the end. Guaranteed reachable.

Example: [2,3,1,1,4]. Minimum jumps: 22. Jump from 00 to 11 (33 steps available), then jump from 11 to 44.

This needs a more sophisticated greedy approach.

You cannot just track furthest.

You need to know when you are forced to jump.

Think BFS: each jump opens a new level of reachable positions.