✅counting->DP || cPP
\n# Code\n\nclass Solution {\npublic:\n\n    int solve(vector<int>& arr,vector<vector<int>>& dp,int i,int j,int k){\n        if(i==j || arr[j]-arr[i]<=k)return 
\n# Code\n```\nclass Solution {\npublic:\n\n    int solve(vector<int>& arr,vector<vector<int>>& dp,int i,int j,int k){\n        if(i==j || arr[j]-arr[i]<=k)return 0;\n        if(dp[i][j]!=-1)return dp[i][j];\n        return dp[i][j]=min(arr[i]+solve(arr,dp,i+1,j,k),arr[j]-arr[i]-k+solve(arr,dp,i,j-1,k));\n    }\n    int minimumDeletions(string word, int k) {\n        map<char,int>mp;\n        for(char i:word){\n            mp[i]++;\n        }\n        vector<int>arr;\n        for(auto itr=mp.begin();itr!=mp.end();itr++)arr.push_back(itr->second);\n        sort(arr.begin(),arr.end());\n        int n=arr.size();\n        vector<vector<int>>dp(n,vector<int>(n,-1));\n        return solve(arr,dp,0,n-1,k);\n    }\n};\n```
['Hash Table', 'String', 'Sorting', 'Counting', 'C++']