Medium · Greedy
Jump Game
Given an array nums where nums[i] is the maximum jump length from index i, start at index 0 and return true if you can reach the last index, or false otherwise.
Examples
Example 1
[2,3,1,1,4] → trueOutput: reachable: true
Example 2
[3,2,1,0,4] → falseOutput: stuck: false
Rebuild it in the studio
Core interview problems are free with a full runner and lessons; Pro opens the complete library.