American Express interview question

Find duplicate in an array