title: Algorithm to find all duplicates in two arrays
body: <p>What is the best algorithm to find all duplicates in two arrays?</p>
  
  <p>What I can think of is brute force algorithm.</p>
  
  <p>Comparing two arrays directly, and once found the same number, store it in the auxiliary array. But the time complexity is <em>O</em>(n<sup>2</sup>).</p>