TD Interview Question

finding duplicates in an array