TD interview question

finding duplicates in an array