WA in SWAPPALI

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

I am getting Wrong Answer in this swapping palindrome question. Earlier I thought that there might be some issue with my logic or may be I am missing some edge cases so i went through the editorial and found that my logic is perfectly fine. But still i am not getting the problem with my code. Someone please help me out to find out the problem in my solution