Zocdoc interview question

write a function to find duplicates in array