Back to problems

Minimum Changes for a Palindromic Periodic Password

Algorithm · Citadel · Medium

Minimum Replacements for a Periodic Palindrome String Medium · Topics · Company Tags · Hints You are given a string s of length n that contains only lowercase English letters, and an integer k that evenly divides n (i.e., n % k == 0). In one move, you may pick any position and change its character to any other lowercase letter. Your goal is to make the string satisfy two conditions: Periodicity: For every valid index i, the character at i and at i + k must be the same. In…

Checking your access…