Jump Game II (Greedy)

Medium

📝 Description

Find the minimum number of jumps to reach the end of the array.

Input Format

[a1, a2, ..., an] (array of non-negative integers)

Output Format

minimum jumps (integer)

Constraints

1 ≤ n ≤ 10^4, 0 ≤ a[i] ≤ 1000

🔍 Sample Input

[2,3,1,1,4]
            

✅ Sample Output

2
            

Code Editor

Please login to run and submit code.

Shortcuts: Ctrl+Enter to submit, Ctrl+Shift+R to run