Find duplicate elements in two lists
Anonymous
If there are no space constrains, then convert one of the arrays into hashtable in O(m), and iterate over the other array to find if the value exists in the hashtable in O(n). Total O(m+n).
Check out your Company Bowl for anonymous work chats.