3 ms·
You can do even better by inserting each element from the array into a hashtable and either discarding or doing a deep compare on collisions. Ignoring the proba
by bartonfink 16y ago
You can do even better by inserting each element from the array into a hashtable and either discarding or doing a deep compare on collisions. Ignoring the probability of collisions, this is O(n) at the cost of extra space.