UBS interview question

DSA Two pointer palindrome question.