Problems

25. Jump Game

MediumArrayAmazonMicrosoft

Each value is the maximum jump length from that position. Determine whether the last index is reachable.

Example 1:

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

Example 2:

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

Constraints:

  • 1 <= nums.length <= 10^4
Core code mode
● Auto-savedLine 1, column 1