Problem Statement | |||||||||||||
A palindromic number is a number that reads the same forward and backward. 101, 4 and 6666 are palindromic numbers while 10, 564 and 15452 are not. You will be given a String n representing a positive integer. Determine the smallest palindromic integer strictly greater than n, and return it as a String with no leading zeroes. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
| - | No positive multiple of 10 is a palindromic number. | ||||||||||||
Constraints | |||||||||||||
| - | n will contain between 1 and 50 characters, inclusive. | ||||||||||||
| - | Each character of n will be a digit ('0'-'9'). | ||||||||||||
| - | The first character of n will not be zero ('0'). | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||
| 4) | |||||||||||||
| |||||||||||||