Jump Game IV
Given an array of integers nums with possible duplicates, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length from that position. Return the minimum number of jumps needed to reach the last index. If it is impossible to reach the last index, return -1.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)