PathAI interview question

Palindrome string