Amazon interview question

Find first duplicate in list