Wrong Answer in PALIN

please help…i’m getting wrong answer. i don’t know wats wrong with the code . Here is the link to my solution
Click Here

1 Like

Its clearly written in the problem statement “Output the palindrome LARGER than k” which means if the string is already a palindrome, u have to still find the next one. Your code fails for this test case. Try 999 or 1111 and it’ll output the same number. Work on this, i.e. for 999 it should output the next one - 1001

1 Like

O.o My code outputs 1001 when 999 is entered … it outputs 6006 when 5999 is entered … outputs 7 when 8 is enetered …