Pergunta de entrevista da empresa Arista Networks

Check if a string is a palindrome string and if not reverse it.