The Entertainer (UAE) interview question

check if a string is a palindrome