Pergunta de entrevista da empresa Scholastic

You're given an array, write a function that returns an array of all of the duplicates found in the input array.