title: How to find the list of pairs in an array using ruby?
body: <p><strong>Input</strong>: </p>
  
  <pre><code>a = [4, 5, 5, 5, 6, 6, 4, 1, 4, 4, 3, 6, 6, 3, 6, 1, 4, 5, 5, 5]
  </code></pre>
  
  <p>How to list out no of pairs in an array.</p>
  
  <p><strong>Output:</strong></p>
  
  <p><strong>9</strong></p>
  
  <p><strong>Description</strong></p>
  
  <pre><code>#no 1(1 pair)
  #no 3(1 pair)
  #no 4(2 pairs)
  #no 5(3 pairs)
  #no 6(2 pairs)
  #so total 9 pairs
  </code></pre>