Back to problems

Minimum Changes for Every Length-K Substring to Be a Palindrome

Algorithm · Citadel · Medium

Password Palindrome Medium · Topics · Company Tags · Hints You are tasked with securing a password. The current password is a string s consisting only of lowercase English letters. You may change any character to any other lowercase letter. You are given an integer k that defines a window size. The security requirement states that every contiguous substring of length k must be a palindrome — in other words, for every starting index i where 0 <= i <= s - k, the substring…

Checking your access…