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/remove_stones.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 other/remove_stones.cpp (limited to 'other/remove_stones.cpp') diff --git a/other/remove_stones.cpp b/other/remove_stones.cpp deleted file mode 100644 index f267b0c..0000000 --- a/other/remove_stones.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int minStoneSum(vector &piles, int k) { - priority_queue pq(piles.begin(), piles.end()); - int ans = accumulate(piles.begin(), piles.end(), 0); - while (k--) { - int i = pq.top(); - pq.pop(); - pq.push(i - i / 2); - ans -= i / 2; - } - return ans; - } -}; - -int main() { - Solution obj; - vector piles1 = {5, 4, 9}, piles2 = {4, 3, 6, 7}; - cout << obj.minStoneSum(piles1, 2); // expect: 12 - cout << endl; - cout << obj.minStoneSum(piles2, 3); // expect: 12 -} -- cgit v1.2.3