Close

Generating next bigger palindrome of a number

Given a number, how do we generate a smallest number which is greater than the given number and is a palindrome?Consider the following examplesInput    Output3         49         1113        22767       777594       595898       909999       1001Here is the solution approach. This problem has multiple cases to be considered.Case 1: If all the digits in the number are ‘9’, the output…