Recursive C++ Solution
Intuition\n- sort frequency array in descending order\n- we can either reduce minimum freq to 0 or make max freq to min(freq) + k\n- use recursion to find minim
# Intuition\n- sort frequency array in descending order\n- we can either reduce minimum freq to 0 or make max freq to min(freq) + k\n- use recursion to find minimum from both operations\n\n# Code\n```\nclass Solution {\npublic:\n    int minimumDeletions(string word, int k) {\n        vector<int> freq(26, 0);\n        for(int i=0;i<word.size();i++)freq[word[i]-\'a\']++;\n        sort(freq.begin(), freq.end());\n        int end = 25,beg=0;\n        for(int i=0;i<26;i++)if(freq[i]!=0){\n            beg=i;\n            break;\n        }\n        return minimumDel(freq, k, beg, end);\n    }\n    \n    int minimumDel(vector<int>& a, int k, int start, int end) {\n        if(start==end || a[end]-a[start]<=k)return 0;\n        return min(a[start] + minimumDel(a, k, start+1, end), a[end]-a[start]-k+minimumDel(a, k, start, end-1));\n    }\n};\n```
['C++']