4 ms·
Could also just use a hashtable, the keys are the array elements and the items are the occurrence of each element, then return the one with an occurrence of 2.
by curiousgal 4y ago
Could also just use a hashtable, the keys are the array elements and the items are the occurrence of each element, then return the one with an occurrence of 2.
- 3np 4y agoOr just a hashset and return when about to insert an existing element.