-
Notifications
You must be signed in to change notification settings - Fork 60
[PROBLEM] 45. Jump Game II #138
Copy link
Copy link
Open
Labels
difficulty: mediumMedium difficulty problem.Medium difficulty problem.hacktoberfestHacktoberfest issue.Hacktoberfest issue.problemLeetCode problem.LeetCode problem.
Description
Activity
Metadata
Metadata
Assignees
Labels
difficulty: mediumMedium difficulty problem.Medium difficulty problem.hacktoberfestHacktoberfest issue.Hacktoberfest issue.problemLeetCode problem.LeetCode problem.
Difficulty
Medium
Problem Description
You are given a 0-indexed array of integers
numsof 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 < nReturn 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 <= 1040 <= nums[i] <= 1000nums[n - 1].Link
https://leetcode.com/problems/jump-game-ii/