Pergunta de entrevista da empresa Microsoft

Create a function that returns the duplicates in an array