Algorithm · Ramp · Medium
Problem: Fewest Edits for a K-Periodic Palindromic Password You are given a password string password with length n, together with an integer k. A single operation replaces any character in password with any lowercase English letter. Determine the smallest number of operations required to produce a password meeting both of these requirements: The resulting password is k-periodic: whenever i + k < n, the characters at positions i and i + k are equal. The repeating pattern of…
Checking your access…