2770. Maximum Number of Jumps to Reach the Last Index

php dev.to

2770. Maximum Number of Jumps to Reach the Last Index Difficulty: Medium Topics: Senior, Array, Dynamic Programming, Weekly Contest 353 You are given a 0-indexed array nums of n integers and an integer target. You are initially positioned at index 0. In one step, you can jump from index i to any index j such that: 0 -target Return 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. Example 1: Input: nums = [1,3,6,4,1,2

Read Full Tutorial open_in_new
arrow_back Back to Tutorials