One example: 2,2,3,3,3,5,5,6,6,9,9Are you sure about that? If only one number in the list appears an odd number of times, then a much more efficient solution than a hash table is simply to take the XOR of all the numbers in the list. I'd have assumed that's what they were looking for. It's not really like MS to test whether you know specific APIs.
Write a routine that finds the number in the above set that shows up an odd number of times. Do it _now_ without any reference. Do it while under the pressure of someone waiting for you to do it.
The interviewer wants to see you use a hash in the solution.
Dec 13, 2004 at 7:40 PM