simple and easy
\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(1)\n\n# Code\n\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n  
\n# Complexity\n- Time complexity:\n**O(n)**\n\n- Space complexity:\n**O(1)**\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        vector<int> freq(26, 0);\n\n        for(char &ch : word) {\n            freq[ch-\'a\']++;\n        }\n\n        sort(begin(freq), end(freq));\n\n        int result           = INT_MAX;\n        int deleted_till_now = 0;\n\n        for(int i = 0; i < 26; i++) {\n\n            int minFreq = freq[i];\n            int temp    = deleted_till_now; //temp taken to find deletion for j = 25 to j > i\n\n            for(int j = 25; j > i; j--) {\n                if(freq[j] - freq[i] <= k) \n                    break;\n                \n                temp += freq[j] - minFreq - k;\n            }\n\n            result = min(result, temp);\n            deleted_till_now += minFreq;\n\n        }\n\n        return result;\n    }\n};\n```
['Two Pointers', 'Sorting', 'C++']