Skip to content
Advertisement

Make largest palindrome by changing at most K-digits from given numerical string using python?

Make largest palindrome by changing at most K-digits from the given numerical string using the python programming.

Advertisement

Answer

“Hello, ALL..This program help you to make the numerical string as largest palindrome with ‘k’number of changes !”

!/usr/bin/python

JavaScript

I’ve used list instead of string so that we can manipulate using the index and join the list to give out as string

“”.join(palindrome(list(“45611”),1))

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement