Question d’entretien chez BlackBerry

write a function which returns duplicates in an array