Jump Game

Medium · Greedy · about 15 minutes

Asked at Amazon, Microsoft, Apple, Meta.

You begin at position 0 of nums. From position i you may jump forward any distance from 1 up to nums[i]. Decide whether you can get to the final position.