solved a palindrome problem