Python DP solution (no recursion)
```\nclass Solution:\n    def palindromePartition(self, s: str, k: int) -> int:\n        if k == len(s):\n            return 0\n\n        dp = [[float(\'inf\')]
```\nclass Solution:\n    def palindromePartition(self, s: str, k: int) -> int:\n        if k == len(s):\n            return 0\n\n        dp = [[float(\'inf\')]*(k+1) for _ in range(len(s)+1)]\n        dp[0][0] = 0\n        \n        def is_palindrome(a,b):\n            b -= 1\n            operation_cost = 0\n            while a < b:\n                if s[a] != s[b]:\n                    operation_cost += 1\n                a += 1\n                b -= 1\n            return operation_cost\n        \n        for i in range(1,len(dp)):\n            for j in range(i):\n                op_cost = is_palindrome(j,i)\n                for k in range(1,len(dp[0])):\n                    dp[i][k] = min(dp[i][k],dp[j][k-1] + op_cost)\n        return dp[-1][-1]
[]