TOO EASY DP
Intuition\ndp\n\n# Approach\ndp\n\n# Complexity\n- Time complexity:\no(2626)\n\n- Space complexity:\no(2626)\n\n# Code\n\nclass Solution {\npublic:\n    int hel
# Intuition\ndp\n\n# Approach\ndp\n\n# Complexity\n- Time complexity:\no(26*26)\n\n- Space complexity:\no(26*26)\n\n# Code\n```\nclass Solution {\npublic:\n    int helper(int i,int j,vector<int> &freq,int k,vector<vector<int>> &dp)\n    {\n        if(i==j || freq[j]-freq[i]<=k)\n        return 0;\n        if(dp[i][j]!=-1)\n        return dp[i][j];\n        \n        int ans=min(freq[i]+helper(i+1,j,freq,k,dp),freq[j]-freq[i]-k+helper(i,j-1,freq,k,dp));\n        return dp[i][j]=ans;\n    }\n    int minimumDeletions(string word, int k) {\n       vector<int> freq(26,0);\n       for(auto x:word)\n       {\n        freq[x-\'a\']++;\n       }\n       sort(freq.begin(),freq.end());\n       vector<vector<int>> dp(26,vector<int> (26,-1));\n       return helper(0,25,freq,k,dp);\n    }\n};\n```
['C++']