O62
Jump Game II (Minimum Jumps)
Problem Statement & Objective
Given an array of non-negative integers nums, return the minimum number of jumps to reach the last index.
Function Signature (Python)
jump_game_ii_minimum_jumps(nums: list[int]) -> intInput & Output Contract
Output Rule:Minimum atlama sayısı.
System Constraints
1 <= sayilar.length <= 10^4
0 <= sayilar[i] <= 1000Example Execution Walkthrough
sayilar = [2, 3, 1, 1, 4] -> 0. indeksten (2) 1. indekse atla, oradan (3) son indekse atla -> 2 atlamaExample Test Scenarios (3)
Example 1
Input:
[[2,3,1,1,4]]Expected Output:
2Example 2
Input:
[[2,3,0,1,4]]Expected Output:
2Example 3: Zaten Sonda
Input:
[[0]]Expected Output:
0