medium

Jump Game

You start at the first index of an array where each value is the maximum jump length from that position. Determine whether you can reach the last index.

Constraints
  • 1 ≤ n ≤ 10^4
  • 0 ≤ nums[i] ≤ 10^5
Examples
in: nums = [2,3,1,1,4]
out: true
in: nums = [3,2,1,0,4]
out: false

Code it yourself

Solve in
Test execution is not yet available for this exercise.Practice journal →Draft saved in this browser.
Hints:
Which approach applies?

Choose an approach to check your pattern recognition, or reveal the discussion when you need help.