Jack Spade interview question

Finding duplicates in an array