O76

Koko Eating Bananas

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

Problem Statement & Objective

Koko loves to eat bananas. Return the minimum integer k such that she can eat all the bananas within h hours.

Function Signature (Python)

min_eating_speed(piles: list[int], h: int) -> int

Input & Output Contract

Output Rule:Minimum saatlik hız k (tam sayı).

System Constraints

1 <= yiginlar.length <= 10^4
yiginlar.length <= h <= 10^9
1 <= yiginlar[i] <= 10^9

Example Execution Walkthrough

yiginlar = [3, 6, 7, 11], h = 8 -> k = 4 hızında: ceil(3/4)+ceil(6/4)+ceil(7/4)+ceil(11/4) = 1+2+2+3 = 8 saat -> cevap: 4

Example Test Scenarios (3)

Example 1
Input:[[3,6,7,11],8]
Expected Output:4
Example 2: h = n
Input:[[30,11,23,4,20],5]
Expected Output:30
Example 3
Input:[[30,11,23,4,20],6]
Expected Output:23
Loading Python Editor...
Input Parameters
[
  [
    3,
    6,
    7,
    11
  ],
  8
]
Expected Output
4