Minimize changes for k-periodic palindrome | Citadel Interview Question