Appian Interview Question

We need you to code a function that returns the first repeated element or a list