From a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 27 Jun 2025 12:23:02 -0600 Subject: chore: remove old cpp and rust solutions --- other/koko_eating_bananas.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 other/koko_eating_bananas.cpp (limited to 'other/koko_eating_bananas.cpp') diff --git a/other/koko_eating_bananas.cpp b/other/koko_eating_bananas.cpp deleted file mode 100644 index 3076169..0000000 --- a/other/koko_eating_bananas.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// 875. Koko Eating Bananas -#include "leetcode.h" - -// return minimum integer 'k' such that koko can eat all bananas within 'h' -// hours - -class Solution { -public: - int minEatingSpeed(vector &piles, int h) { - int l = 1, r = 1000000000; - while (l < r) { - int m = (l + r) / 2, total = 0; - for (int p : piles) - total += (p + m - 1) / m; - if (total > h) - l = m + 1; - else - r = m; - } - return l; - } -}; - -int main() { - Solution obj; - vector p1 = {3, 6, 7, 11}, p2_3 = {30, 11, 23, 4, 20}; - printf("%d\n", obj.minEatingSpeed(p1, 8)); // expect: 4 - printf("%d\n", obj.minEatingSpeed(p2_3, 5)); // expect: 30 - printf("%d\n", obj.minEatingSpeed(p2_3, 6)); // expect: 23 -} -- cgit v1.2.3