pyassistant

Min changes to partition string into k palindromic substrings

Partition a string into k non-empty contiguous substrings so the total number of character changes needed to make every substring a palindrome is minimized. Return that minimal number of character changes.

Example:

Input:
("abcbd", 2)
Output:
1

Make sure you return your solution, don't print!

AI

Bot

Trying to solve my challenge? Ask if you must, or press the purple button so I can analyze your code.