UST interview question

Find duplicate elements an array