CapTech interview question

Find duplicates in an array