Arista Networks Interview Question

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