title: How to merge array of hash based on the same keys in ruby?
body: <p>How to merge array of hash based on the same keys in ruby?</p>
  
  <p>example :</p>
  
  <pre><code>a = [{:a=&gt;1},{:a=&gt;10},{:b=&gt;8},{:c=&gt;7},{:c=&gt;2}]
  </code></pre>
  
  <p>How to get result like this?</p>
  
  <pre><code>a = [{:a=&gt;[1, 10]},{:b=&gt;8},{:c=&gt;[7, 2]}]
  </code></pre>