Elsevier interview question

Implement isPalindrome function.