Video Explanation (Along with a HARDER VERSION)
Explanation \n\nClick here for the video\n\n# Code\n\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        vector<int> frq(26);\n 
# Explanation \n\n[Click here for the video](https://youtu.be/NAWNz8caFK8)\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        vector<int> frq(26);\n        for (auto c : word) frq[c-\'a\'] ++;     \n        \n        int ans = 1e5;\n        \n        for (int l = 1; l <= 100000; l ++) {\n            int r = min (l+k, 100000);\n            int cost = 0;\n\n            for (int ch = 0; ch < 26; ch ++) {\n                if (frq[ch] < l) cost += frq[ch];\n                if (frq[ch] > r) cost += (frq[ch] - r);\n            }\n            ans = min (ans, cost);\n        }\n        return ans;\n    }\n};\n```
['C++']