More Intuitive Dp approach
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int solve(int i, int j , int k, vector<int>&freq, vector<vector<int>>&dp){\n        if (i==j) return 0;\n        if (dp[i][j]!=-1)return dp[i][j];\n        if (freq[j]-freq[i] <=k) return 0;\n        int back = freq[j]-(k+freq[i]) +solve(i, j-1, k, freq, dp);\n        int front = freq[i] + solve(i+1, j, k, freq, dp);\n        return dp[i][j] = min(front, back);\n    }\n    int minimumDeletions(string word, int k) {\n        unordered_map<char,int>mpp;\n        vector<int>freq;\n        for (auto c : word) mpp[c]++;\n        for(auto it : mpp) freq.push_back(it.second);\n        sort(freq.begin(), freq.end());\n        int n = freq.size();\n        vector<vector<int>>dp(n, vector<int>(n, -1));\n        return solve(0, n-1,k, freq, dp);\n    }\n};\n```
['C++']