Minimum Replacements for Palindromic Fixed-Size Blocks

Given a lowercase English string s and a positive integer k, split s from left to right into consecutive blocks of size k. The final block may have fewer than k characters.

In one operation...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: