Jump Game II (Minimum Jumps)

Medium · Greedy · about 20 minutes

Asked at Amazon, Google, Microsoft.

You begin at position 0 of nums. From position i you may jump forward any distance from 1 up to nums[i], and the final position can always be reached. What is the fewest number of jumps that gets you there?