O62

Jump Game II (Minimum Jumps)

Mid / Senior Engineer
Target Time: 25 - 35 Minutes
Type: NUMERIC

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]) -> int

Input & Output Contract

Output Rule:Minimum atlama sayısı.

System Constraints

1 <= sayilar.length <= 10^4
0 <= sayilar[i] <= 1000

Example Execution Walkthrough

sayilar = [2, 3, 1, 1, 4] -> 0. indeksten (2) 1. indekse atla, oradan (3) son indekse atla -> 2 atlama

Example Test Scenarios (3)

Example 1
Input:[[2,3,1,1,4]]
Expected Output:2
Example 2
Input:[[2,3,0,1,4]]
Expected Output:2
Example 3: Zaten Sonda
Input:[[0]]
Expected Output:0
Loading Python Editor...
Input Parameters
[
  [
    2,
    3,
    1,
    1,
    4
  ]
]
Expected Output
2