Skip to content

Commit b344089

Browse files
Merge pull request #381 from div910/main
Day-17 q3 added
2 parents 3d17d31 + 14c3f13 commit b344089

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Day-17/q3: Jump Game/question.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Jump Game
2+
3+
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.
4+
Return true if you can reach the last index, or false otherwise.
5+
6+
### Example 1:
7+
8+
Input: nums = [2,3,1,1,4]
9+
Output: true
10+
Explanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.
11+
12+
### Example 2:
13+
14+
Input: nums = [3,2,1,0,4]
15+
Output: false
16+
Explanation: You will always arrive at index 3 no matter what. Its maximum jump length is 0, which makes it impossible to reach the last index.
17+
18+
### Constraints:
19+
20+
1 <= nums.length <= 104
21+
0 <= nums[i] <= 105

0 commit comments

Comments
 (0)