Interview Question

Software Engineer II Interview

Given an array of positive integers, print out all the

  numbers which are repeated an even number of times ? Can you do this without using additional storage ?

Interview Answer

2 Answers


If you use additional storage such as a hash, you can do this in O(n). if we don't then worst case would be nlogn as we can sort and then the same number should be adjacent to each other.

Anonymous on Feb 18, 2011

nlogn sort algorithm

eh on Feb 21, 2011

Add Answers or Comments

To comment on this question, Sign In with Facebook or Sign Up