Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Jump Game
Medium
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
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.
Sample Input:
[2, 3, 1, 1, 4]
Sample Output:
true
Hints
Hint 1
Track the farthest position you can reach
Hint 2
Update farthest at each step
Hint 3
Return false if you cannot reach current position
Code Editor
Reset
Run
Save
Loading...