You are given an integer array nums. Each element represents your maximum jump length at that position.
Starting at the first index, determine if you can reach the last index.
nums)Input:
[2,3,1,1,4]
Output: true
Input:
[3,2,1,0,4]
Output: false
Input:
[0]
Output: true
Your program must print only true or false
so it can be compared with the expected output.
No submissions yet.
Discuss greedy vs DP approaches, edge cases, and time complexity.