You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.
Return true if you can reach the last index, or false otherwise.
nums = [2,3,1,1,4]truenums = [3,2,1,0,4]falsenums = [0]true1 <= nums.length <= 10^40 <= nums[i] <= 10^5Expected time complexity: O(n)Run your code to see results
Use Cmd+Enter to run