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/min_deletions_unique_char.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 other/min_deletions_unique_char.cpp (limited to 'other/min_deletions_unique_char.cpp') diff --git a/other/min_deletions_unique_char.cpp b/other/min_deletions_unique_char.cpp deleted file mode 100644 index c971b21..0000000 --- a/other/min_deletions_unique_char.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int minDeletions(string s) { - vector freq(26, 0); - int ans = 0; - for (char c : s) - freq[c - 'a']++; - sort(freq.begin(), freq.end()); - for (int i = 24; i >= 0; i--) { - if (freq[i] == 0) - break; - if (freq[i] >= freq[i + 1]) { - int prev = freq[i]; - freq[i] = max(0, freq[i + 1] - 1); - ans += prev - freq[i]; - } - } - return ans; - } -}; - -int main() { - Solution obj; - string s = "aab"; - cout << obj.minDeletions(s); -} -- cgit v1.2.3