brute force
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        // i think the first thing we should do is abstract the counts into a hashmap or smth.\n        vector<int> counts(26, 0);\n\n        for (int i = 0; i < word.size(); i += 1) {\n            char curr = word[i];\n            counts[curr - \'a\'] += 1;\n        }\n\n        // how about we we two pointer this.\n        // our array should be the number of unique chars in each situation right.\n        sort(counts.begin(), counts.end());\n        int res = INT_MAX;\n        int deleted = 0;\n\n        // brute force search\n        for (int i = 0; i < 26; i += 1) {\n            int minfreq = counts[i];\n            int tmp = deleted;\n\n            for (int j = 25; j > i; j -= 1) {\n                if (counts[j] - counts[i] <= k) \n                    break;\n\n                // num deletions\n                tmp += counts[j] - minfreq - k;\n            }\n\n            res = min(res, tmp);\n            deleted += minfreq;\n        }\n\n        return res;\n    }\n};\n```
['C++']