Palindromes Problem with code:PALIN

I am trying to solve the Palindromes Practice Problem.All the testcases are satisfied but i still get WA.If someone could help me debug/fix my code or tell me where i have made a mistake it would help me a lot.Here is my code: Solution: 48233972 | CodeChef

See my code and try to understand.
Lapindrome

Consider the test input:

1
aaaa

Edit:

Either you’re linking to the wrong solution or the problem code in the title and the problem name in your post is wrong :stuck_out_tongue:

1 Like

I changed it a bit so that your input works and generally evey input with a simillar “form” like yours works but i still get WA.Here is my latest code: Solution: 48262729 | CodeChef

Consider the test input:

1
gdgggd
1 Like

First of all thank you for answering so quickly!!
As for the suggested input i again changed my code a bit and it works cause it returns nothing for the case 1 and YES for the case gdgggd.Here is my new code:
Solution: 48269344 | CodeChef

I know my code is a bit scuffed and that there may be an easier way but i would like to make it work as it is if it is possible.

1 Like
2
abba
abba
1 Like

Thank you so much!!!
I changed it a bit again and it finally worked!!
Here is my final code: Solution: 48275255 | CodeChef

1 Like