in reply to Re^4: Challenge: Nearest Palindromic Number
in thread Challenge: Nearest Palindromic Number

Which is why I initially mentioned that incrementing would be easy, to find the alternative. If the input isn't already palindromic, you have to find two palindromic alternatives. Roy Johnson wrote the code I foresaw: '10##'++ would be '1111'.

--
[ e d @ h a l l e y . c c ]

  • Comment on Re^5: Challenge: Nearest Palindromic Number