Find the difference between two unsorted sets (lists). Interviewer eventually revealed that he wanted a solution in O(n) time.
Anonymous
were the values in the list a particular type? If so, you could convert each list into a string and then add each string of set a into a hashSet A and then each string of set b into a hashSet B, and compare the hashSets ( a hash map with no values...just ordered keys) ... in O(n)
Check out your Company Bowl for anonymous work chats.