Pergunta de entrevista da empresa Horizontal

Palindrome question and code for the same