Jump Game
You are given an integer array nums where each element represents your maximum jump length from that position.
Initially, you are positioned at the first index of the array.
Return true if you can reach the last index; otherwise, return false.
Example 1
Input
5 2 3 1 1 4
Output
true
Explanation
Jump 1 step from index 0 to index 1, then jump 3 steps to reach the last index.
Hence, it is possible to reach the last index.
Example 2
Input
5 3 2 1 0 4
Output
false
Explanation
No matter how you jump, you will eventually reach index 3, where the maximum jump length is 0.
Therefore, the last index cannot be reached.
Constraints
Hints:
Hint 1
Keep track of the farthest index that can be reached while traversing the array.
Hint 2
If you encounter an index beyond the farthest reachable position, it is impossible to reach the end. Otherwise, continuously update the farthest reachable index.
Author & Technical Reviewer
Technically reviewed by: ExamAdda Technical Review Team
Technical Reviewers, ExamAdda
Software engineers at ExamAdda who check every article's definitions, complexity claims and code examples before and after publishing.
Published
Aug 4, 2026
Last updated
Aug 4, 2026
Content Verification Methodology
Definitions and complexity claims were checked against authoritative computer-science references. Code examples were compiled and tested with standard, boundary and edge-case inputs.
Expected Output