News for hackers. Stuff that matters.
Re:I cheated on my Microsoft interview (2019) by curiousgal on Sunday June 05, 2022 @05:28AM (#31629328)
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.
Re:I cheated on my Microsoft interview (2019) by 3np on Sunday June 05, 2022 @05:59AM (#31629521)
Or just a hashset and return when about to insert an existing element.