Solving Koko Eating Bananas in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Koko likes to eat slowly, but still wants to finish eating all the bananas before the guards come back.

Example 1:

Input: piles = [3,6,7,11], H = 8
Output: 4

Example 2:

Input: piles = [30,11,23,4,20], H = 5
Output: 30

Example 3:

Input: piles = [30,11,23,4,20], H = 6
Output: 23

Note:

  • 1 <= piles.length <= 10^4

  • piles.length <= H <= 10^9

  • 1 <= piles[i] <= 10^9

  • 1 <= piles.length <= 10^4

  • piles.length <= H <= 10^9

  • 1 <= piles[i] <= 10^9

See the full details of the problem Koko Eating Bananas at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go