English - January 2020 long challenge

Why my solution is not working even with palindrome?
Solution link: CodeChef: Practical coding for everyone