Question d’entretien chez Amazon

How would you remove common elements from a two arrays.

Réponse à la question d'entretien

Utilisateur anonyme

19 mai 2012

input: array1, array2 output: array3, array4 make a hashmap load array2 into the hashmap iterate over array1, elements that are not in the hashmap are added to array3 make a hashmap load array1 into the hashmap iterate over array2, elements that are not in the hashmap are added to array4