My solution for the palindrome problem.