rosetta code palindrome problem