Company: Zorvyn SDE_3april
Difficulty: medium
Q 1/2. Problem Mamba loves to eat frogs. There are n groups of frogs, the ith group has groups[i] frogs. The guards have gone and will come back in h hours. mamba can decide his frogs-per-hour eating speed of k. Each hour, he chooses some group of frogs and eats k frogs from that group. If the group has less than k frogs, he eats all of them instead and will not eat any more frogs during this hour. mamba likes to eat slowly but still wants to finish eating all the frogs before the guards return. Return the minimum integer k such that he can eat all the frogs within h hours. Example 1: Input: groups = [3,6,7,11], h = 8 Output: 4 Example 2: Input: groups = [30,11,23,4,20], h = 5 Output: 30 Example 3: Input: groups = [30,11,23,4,20], h = 6 Output: 23 Constraints: 1 <= groups.length <= 10 4 groups.length <= h <= 10 9 1 <= groups[i] <= 10 9