Arista Networks interview question

Palindrome and simple recursion problem