Apple Interview Question

Code: A function to detect a palindrome