Given two lists, return a list of elements that appear in both.
Anonymous
I initially was using a hashmap to store all the elements and keep track of the repeats, but this was inefficient. Later I changed to keeping track of the indices in each list after.
Check out your Company Bowl for anonymous work chats.