title: Pushing max hash key-values into an array in Ruby?
body: <p>I have a hash called <code>count</code>, defined as <code>count = {4=&gt;2, 5=&gt;3, 6=&gt;3, 7=&gt;1}</code>.</p>
  
  <p>I want to take the <code>max</code> value, and then push the key that corresponds to that value into an array, so I do this:</p>
  
  <pre><code>array = []
  array.push(count.max_by{|k,v| v}[0])
  
  =&gt;&gt; [5]
  </code></pre>
  
  <p>However, <code>6</code> also has the value <code>3</code>, which is another maximum value. How do I push this value into the array so I get <code>[5,6]</code> instead of just <code>[5]</code>?</p>