Given an integer array `nums`, where each element represents the maximum jump length from that position, determine if you can reach the last index starting from index 0. For example, given nums = [2,3,1,1,4], you can jump from index 0 to index 1 (jump 1 step), then from index 1 to the last index (jump 3 steps), so the answer is true. Given nums = [3,2,1,0,4], no matter what you do, you will always arrive at index 3 whose value is 0, so you can never reach the last index.
Example 1
Input: nums = [2,3,1,1,4]
Output: true
Explanation: Jump 1 step from index 0 to index 1, then jump 3 steps from index 1 to the last index.
Example 2
Input: nums = [3,2,1,0,4]
Output: false
Explanation: Every route lands on index 3, whose value is 0, so you can never jump past it to reach index 4.
Example 3
Input: nums = [0]
Output: true
Explanation: You already start at the last index, so no jump is needed.
Scan left to right, maintaining the farthest index you can reach. If you ever stand on an index beyond the farthest reach, you are stuck. If the farthest reach covers the last index, you can make it.
Run checks all cases above. Submit evaluates all test cases.