I was trying to solve the PALIN problem using C++, but my solution keeps giving Wrong Answer. When I try it in Eclipse, it seems to work properly.
Here's my code: http://ideone.com/VDDC8Y
Here's an image of one of my test cases:

I'm not sure what's wrong, because it appears to give the right answer for many of my test cases.
Also, if the error is that the brute force is taking too long, shouldn't it give Time Limit Exceeded or something else?
Thanks for your hepl!