Jump Game
You are given an integer array nums. You start at the first index, and each element nums[i] is the **maximum** number of steps you can jump forward from that position.
Return true if you can reach the last index, and false otherwise.
Example cases
- reachablein nums = [2,3,1,1,4]out trueJump 1 step to index 1, then 3 steps to the last index.
- stuck at zeroin nums = [3,2,1,0,4]out falseYou always land on index 3, whose value 0 lets you go no further.
- singlein nums = [0]out trueAlready at the last index.
Constraints
- 1 <= nums.length <= 10^4
- 0 <= nums[i] <= 10^5
nums =
[2,3,1,1,4]