C++
\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        unordered_map<char, int>Map;\n        for(auto ch : word){\n            Map
```\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        unordered_map<char, int>Map;\n        for(auto ch : word){\n            Map[ch]++;\n        }\n        vector<int>Count;\n        for(auto [_, t] : Map){\n            Count.push_back(t);\n        }\n        sort(Count.begin(), Count.end());\n        int ret = INT_MAX;\n        for(int i = 0; i < Count.size(); i++){\n            int tmp = 0;\n            int base = Count[i];\n            for(int j = 0; j < Count.size(); j++){\n                if(Count[j] - base > k)\n                    tmp += Count[j] - base - k;\n                else if(Count[j] < base)\n                    tmp += Count[j];\n            }\n            ret = min(ret, tmp);\n        }\n        return ret;\n    }\n};\n```
[]