Beats 100% time | 86% space || easy solution using frequency array
Complexity\n- Time complexity: 0(n)\n- Beats complexity: 0(everybody)\n- Space complexity: 0(n)\n\n# Code\ncpp []\nclass Solution {\npublic:\n    int minimumDel
# Complexity\n- Time complexity: 0(n)\n- Beats complexity: 0(everybody)\n- Space complexity: 0(n)\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        ios::sync_with_stdio(false);\n        cin.tie(nullptr);\n        cout.tie(nullptr);\n        vector<int> arr(26);\n        for (int i = 0; i < word.size(); i++) {\n            arr[word[i] - \'a\']++;\n        }\n        int ans = INT_MAX;\n        for (int i = 0; i < arr.size(); i++) {\n            if (arr[i] == 0) {\n                continue;\n            }\n            int cur = 0;\n            for (int j = 0; j < arr.size(); j++) {\n                if (arr[j] == 0) {\n                    continue;\n                }\n                if (arr[i] > arr[j]) {\n                    cur += arr[j];\n                }\n                else {\n                    if (arr[j] - arr[i] > k) {\n                        cur += arr[j] - arr[i] - k;\n                    }\n                }\n            }\n            ans = min(ans, cur);\n        }\n        return ans;\n    }\n};\n```
['C++']