[PROBLEM] 45. Jump Game II #138
Labels
difficulty: medium
Medium difficulty problem.
hacktoberfest
Hacktoberfest issue.
problem
LeetCode problem.
Difficulty
Medium
Problem Description
You are given a 0-indexed array of integers
nums
of lengthn
. You are initially positioned atnums[0]
.Each element
nums[i]
represents the maximum length of a forward jump from indexi
. In other words, if you are atnums[i]
, you can jump to anynums[i + j]
where:0 <= j <= nums[i]
andi + j < n
Return the minimum number of jumps to reach
nums[n - 1]
. The test cases are generated such that you can reachnums[n - 1]
.Example 1:
Example 2:
Constraints:
1 <= nums.length <= 104
0 <= nums[i] <= 1000
nums[n - 1]
.Link
https://leetcode.com/problems/jump-game-ii/
The text was updated successfully, but these errors were encountered: