Pregunta de entrevista de Amazon

How would you remove common elements from a two arrays.

Respuesta de la entrevista

Anónimo

19 may 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