Amazon interview question

write a function that validates whether a string is a palindrome