##
Make largest palindrome by changing at most K-digits
March 15, 2017

Given a string containing all digits, we need to convert this string to a palindrome by changing at most K digits. If many solutions are possible then print lexicographically largest one. Examples: Input : str = “43435” k = 3 Output : “93939” Lexicographically largest palindrome after 3 changes is “93939” Input : str =… Read More »