Horizontal Interview Question

Palindrome question and code for the same