Minimum Changes for a Palindromic Periodic Password

Given a lowercase password s of length n and a period k, where n is divisible by k, you may replace any character with any lowercase letter.

A password is valid if:

  1. It has period k: f...

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: