Skip to content

Commit a6047f8

Browse files
iamAntimPalAntim-IWPIamShiwangi
committed
Create 875. Koko Eating Bananas.py
Co-Authored-By: Antim-IWP <203163676+Antim-IWP@users.noreply.github.com> Co-Authored-By: Shiwangi Srivastava <174641070+IamShiwangi@users.noreply.github.com>
1 parent 3a21746 commit a6047f8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution:
2+
def minEatingSpeed(self, piles: List[int], h: int) -> int:
3+
def check(k: int) -> bool:
4+
return sum((x + k - 1) // k for x in piles) <= h
5+
6+
return 1 + bisect_left(range(1, max(piles) + 1), True, key=check)

0 commit comments

Comments
 (0)