MCM variant
\nclass Solution {\npublic:\n    int t[102][102][102];\n    int check(string &s, int start, int end) {\n        int ans=0;\n        while(start<end) {\n        
```\nclass Solution {\npublic:\n    int t[102][102][102];\n    int check(string &s, int start, int end) {\n        int ans=0;\n        while(start<end) {\n            if(s[start++]!=s[end--])\n                ans++;            \n        }\n        return ans;\n    }\n    int helper(string s, int start, int end, int k) {\n        if(start>end) {\n            if(k<=0)\n                return 0;\n            else\n                return INT_MAX;     // to ignore cases wherein k is still greater than 0, we will return INT_MAX\n        }          \n        \n        int length=end-start+1;\n        if(k>length)\n            return INT_MAX;  // same here also, to ignore this case\n        if(k==length)\n            return 0;\n        \n        if(t[start][end][k]!=-1)\n            return t[start][end][k];\n        \n        if(k==1){\n            return t[start][end][k] = check(s,start,end);            \n        }\n        \n        int ans=INT_MAX;\n        for(int i=start; i<end; i++) {\n            int a=helper(s,start,i,1);\n            int b=helper(s,i+1,end,k-1);\n            if(a==INT_MAX || b==INT_MAX)\n                continue;\n            ans=min(a+b, ans);\n        }\n        return t[start][end][k]=ans;\n    }\n    int palindromePartition(string s, int k) {\n        memset(t,-1,sizeof(t));\n        return helper(s,0,s.length()-1,k);\n    }\n};\n```
['Dynamic Programming', 'Recursion', 'Memoization', 'C']