Meta Interview Question

Find the duplicated elements of two arrays.

Interview Answers

Anonymous

Mar 28, 2018

Use hash table. - insert a dummy element to the hash table using the values in the first array as key. - try to retrieve from the hash table with the values in the second array as key. ----- if there is a hit, the value used as the key is the answer

Anonymous

Mar 28, 2018

That's exactly what I said. But he wanted a 2 pointers solution. After prompting, I got it right but was still being rejected.