MaxLinear interview question

Finding the duplicates in an array