C++ solution
Code\n\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        unordered_map<char, int> m;\n        int n = word.size();\n        fo
# Code\n```\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        unordered_map<char, int> m;\n        int n = word.size();\n        for(int i = 0; i < n; i++) {\n            m[word[i]]++;\n        }\n        vector<int> v;\n        for(auto it : m) {\n            v.push_back(it.second);\n        }\n        sort(v.begin(), v.end());\n        int s = v.size();\n        int ans = INT_MAX;\n        int x = 0;\n        for(int i = 0; i < s; i++) {\n            int y = 0;\n            for(int j = s - 1; j > i; j--) {\n                if(v[j] - v[i] <= k) break;\n                y += v[j] - v[i] - k;\n            }\n            y += x;\n            ans = min(ans, y);\n            x += v[i];\n        }\n        return ans;\n    }\n};\n```
['C++']