cheetcode

123. Jump GameMedium

Determine whether you can reach the last index.

You are given an integer array nums. Each element represents your maximum jump length at that position.

Return true if you can reach the last index, or false otherwise.

Examples

Input: nums = [2,3,1,1,4]
Output: true
Input: nums = [3,2,1,0,4]
Output: false

Constraints

  • 1 <= nums.length <= 10,000
  • 0 <= nums[i] <= 100,000