Problem 2911 · Hard

Minimum Changes to Make K Semi-palindromes

Precompute the change cost of every substring as a semi-palindrome, then DP over the number of parts.

Open the interactive visualisation