Toast Inc Interview Question

Palindrome validation for a string