Toast Inc interview question

Early stage tech task was to code a function checking if a string is a palindrome, with a minor complication.