FreeCareerPath
Build the PrimitiveMedium

Jump Game II

Write `min_jumps(nums)` returning the fewest jumps to reach the last index. The last index is always reachable. min_jumps([2,3,1,1,4]) -> 2 Think of it as BFS over ranges: everything reachable in one jump is level one, and so on. Walk forward tracking the end of the current level and the furthest index seen; when you reach the end of the level, that is one more jump. Never jump *from* the last index — that is the off-by-one everyone hits.

What to expect: A timer starts when you begin. Edit the starter code, run it against the test suite as many times as you like, then finish when you're done. The reference solution and interviewer follow-up questions unlock only after you finish.

Log in to start this session

Timed sessions and your results for "Jump Game II" are saved to your account — logging in takes a few seconds.

Jump Game II — FreeCareerPath