Problem
You stand on index 0 of nums. From index i you may jump forward up to nums[i] places. Return true if you can reach the last index.
Example 1
- Input
- nums = [2, 3, 1, 1, 4]
- Output
- true
- Why
- 0 → 1 → 4
Example 2
- Input
- nums = [3, 2, 1, 0, 4]
- Output
- false
- Why
- every route lands on the 0 at index 3
Example 3
- Input
- nums = [0]
- Output
- true
- Why
- you start at the end
Constraints
1 <= nums.length <= 10^40 <= nums[i] <= 10^5