Question d’entretien chez Bloomberg

Write a function that takes in a sorted array and removes duplicate elements from the list.

Réponses aux questions d'entretien

Utilisateur anonyme

22 mars 2015

It is important to clarify all the requirements for implementing above. Is the array in ascending/descending order? What would you do if size parameter is not given to you? How to take into account extremes (max integer value, etc.)? I didn't ask those questions and hence he drilled me on those after I implemented my code and hence messed up. Also I suppose I should have used hash table for checking duplicates.

Utilisateur anonyme

10 oct. 2015

Try using a TreeMap