Simple Hashing || Consider All Possibilities
 # Intuition  \n\n\n# Approach\n1. Initialize an unordered map mp to store the frequency of each character in the word.\n2. Iterate through the characters in th
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n1. Initialize an unordered map mp to store the frequency of each character in the word.\n2. Iterate through the characters in the word and update the frequency in the map.\n3. Create a vector v to store the frequencies of characters.\n4. Sort the frequencies in ascending order.\n5. Find the maximum frequency among all characters.\n6. Iterate from 1 to the maximum frequency (mx).\n7. For each frequency i, calculate the total number of deletions required to make all frequencies equal to i or at most i + k.\n8. Update the minimum number of deletions (ans) encountered so far.\n9. Return the minimum number of deletions.\n\n# Code\n```\nclass Solution\n{\npublic:\n    int minimumDeletions(string word, int k)\n    {\n        unordered_map<char, int> mp;\n        int n = word.size();\n        for (char ch : word)\n            mp[ch]++;\n        vector<int> freq;\n        for (auto x : mp)\n            freq.push_back(x.second);\n        sort(freq.begin(), freq.end());\n        int mx = freq.back(), ans = INT_MAX;\n        for (int i = 1; i <= mx; i++)\n        {\n            int cnt = 0;\n            for (int j = 0; j < freq.size(); j++)\n            {\n                if (freq[j] > i + k)\n                    cnt += freq[j] - i - k;\n                else if (freq[j] < i)\n                    cnt += freq[j];\n            }\n            ans = min(ans, cnt);\n        }\n        return ans;\n    }\n};\n```
['Hash Table', 'Sorting', 'C++']