PALIN - Palindrome question - TLE

Kindly help review the code.

https://www.codechef.com/viewsolution/28490979

TIA

For explanation on how to solve the problem in the given time limit, refer this post: Next Palindrome Problem - #6 by striker22.

For the solution in C refer: The Next Palindrome Solution.

Thanks for reading
Peace :v: