2770. Maximum Number of Jumps to Reach the Last Index
You are given a 0-indexed array
numsofnintegers and an integertarget.You are initially positioned at index
0. In one step, you can jump from indexito any indexjsuch that:
0 <= i < j < n-target <= nums[j] - nums[i] <= targetReturn the maximum number of jumps you can make to reach index
n - 1.If there is no way to reach index
n - 1, return-1.
1 | class Solution { |