title: Algorithm to find the duplicate numbers in an array ---Fastest Way
body: <p>I need the fastest and simple algorithm which finds the duplicate numbers in an array, also should be able to know the number of duplicates.</p>
  
  <p>Eg: if the array is <code>{2,3,4,5,2,4,6,2,4,7,3,8,2}</code></p>
  
  <p>I should be able to know that there are four 2's, two 3's and three 4's.</p>