Memorization + Recursion
\nclass Solution {\npublic:\n    int dp[102][102][102];\n    int minchangepalindrome(int i,int j,string& s){\n        if(i==j|| i>j)\n            return 0;\n   
```\nclass Solution {\npublic:\n    int dp[102][102][102];\n    int minchangepalindrome(int i,int j,string& s){\n        if(i==j|| i>j)\n            return 0;\n        if(s[i]==s[j])\n            return minchangepalindrome(i+1,j-1,s);\n        else\n            return 1+minchangepalindrome(i+1,j-1,s);\n    }\n    int solve(int i,int j,int p,string& s){\n        if(i==j){\n            if(p==1) return 0;\n            else return 10000000; // if partition greater then string length then invalid case , so passing a big number.\n        }\n        if(i>j) return 0;\n        if(dp[i][j][p]!=-1)\n            return dp[i][j][p];\n        if(p==1){\n            return dp[i][j][p]=minchangepalindrome(i,j,s);\n        }\n        int ans=INT_MAX;\n        int temp;\n        for(int k=i;k<j;k++){\n            temp=minchangepalindrome(i,k,s)+solve(k+1,j,p-1,s);\n            ans=min(ans,temp);\n        }\n        return dp[i][j][p]=ans;\n    }\n    int palindromePartition(string s, int p) {\n        int n=s.size();\n        if(p==n)\n            return 0;\n        memset(dp,-1,sizeof(dp));\n        return solve(0,n-1,p,s);\n    }\n};\n```
['Dynamic Programming', 'Recursion', 'Memoization', 'C']