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/reduce_array_size_half.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 other/reduce_array_size_half.cpp (limited to 'other/reduce_array_size_half.cpp') diff --git a/other/reduce_array_size_half.cpp b/other/reduce_array_size_half.cpp deleted file mode 100644 index fd922dc..0000000 --- a/other/reduce_array_size_half.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int minSetSize(vector &arr) { - int ans = 0, n = arr.size(), n1 = 0; - vector j; - unordered_map um; - for (int i = 0; i < n; i++) - um[arr[i]]++; - for (auto x : um) - j.push_back(x.second); - if (j.size() == 1) - return 1; - sort(j.begin(), j.end()); - for (int i = j.size() - 1; i >= 0; i--) { - if (ans >= n / 2) - return n1; - n1++; - ans = ans + j[i]; - } - return 0; - } -}; - -int main() { - Solution obj; - vector arr = {3, 3, 3, 3, 5, 5, 5, 2, 2, 7}; - cout << obj.minSetSize(arr); -} -- cgit v1.2.3