Back to course home
0% completed
Jump Game (medium)
Problem Statement
You are given an array of integers nums
. You start at the first
index of the array and each element in nums
represents the maximum number of steps
you can jump forward from that position.
Return true
if you can reach the last index
, or false
otherwise.
Examples
Example 1
- Input:
nums = [1, 2, 3, 4, 5]
- Expected Output:
true
- Justification: Starting at index 0, you can jump 1 step to index 1. From index 1, you can jump 2 steps to index 3. From index 3, you can jump 1 steps to the last index (4)
.....
.....
.....
Like the course? Get enrolled and start learning!
Table of Contents
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible