Minimum Changes for Palindromic Password

Company: Rippling_19july

Difficulty: medium

Problem Statement

Minimum Changes for Palindromic Password Problem Description A security team stores the current password as a string currentPassword made up of lowercase Latin letters only. A new policy has been announced. The replacement password, newPassword , must have the same length as currentPassword and must satisfy both of the following conditions: newPassword must be a palindrome: it reads the same forwards and backwards. newPassword must have a period of k : newPassword[i] = newPassword[i + k] must hold for every index i for which i + k is still inside the string. You may replace any character of currentPassword with any lowercase Latin letter. Determine the minimum number of characters that have to be changed to turn currentPassword into some valid newPassword . Complete the function findMinChanges with the following parameters: string currentPassword : the current password int k : the required period of the new password Input Format The input is read from standard input: The first line con