C++ | Greedy
Code\n\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        int freq[26] = {0};\n        for(int i = 0; i < word.size(); i++) {\n
# Code\n```\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        int freq[26] = {0};\n        for(int i = 0; i < word.size(); i++) {\n            freq[word[i] - \'a\']++;\n        }\n        int ans = INT_MAX;\n        for(int i = 0; i < 26; i++) {\n            int del = 0;\n            for(int j = 0; j < 26; j++) {\n                if(freq[j] < freq[i]) del += freq[j];\n                else if(freq[j] > freq[i]) del += max(0, freq[j] - freq[i] - k);\n            }\n            ans = min(ans, del);\n        }\n        return ans;\n    }\n};\n```
['String', 'Greedy', 'Counting', 'C++']