Why am i getting WA in PALIN : The Next Pallindrome ?

I wrote the following code for PALIN

C++ Code that I Wrote

I even Checked the Solution for some test cases , like 191 - > 202 , 1 - > 2 , but still I am unable to get what am i missing , Please Help. Or can anyone atleast help me to find the Test Case for which my code is screwing up.

For 10 your program prints 22, should print 11 as you know for sure :wink:

@betlista : Thanks :slight_smile: