Fewest jumps to the end

Each position in jumps says how far you can jump forward from it, and the end is always reachable. Write min_jumps(jumps) that returns the fewest jumps to get from index 0 to the last index.

min_jumps([2, 3, 1, 1, 4])  ->  2
min_jumps([1, 1, 1])        ->  2
min_jumps([5])              ->  0

The point is to practise greedy in layers: everything reachable with j jumps forms a range, and the next range is the furthest any of those positions can reach.

def min_jumps(jumps):
    ...