Convert array of arrays into hash in Ruby
<p>How can I transform <code>array1</code> into <code>hash1</code> in Ruby?</p>

<p><code>array1</code> looks like this: </p>

<pre><code>    [[80, "X", 12],
     [80, "X", 13],
     [80, "X", 14],
     [80, "X", 15],
     [80, "X", 16],
     [81, "Y", 20],
     [81, "Y", 21],
     [81, "Y", 22],
     [81, "Y", 23],
     [81, "Y", 24]]
</code></pre>

<p><code>hash1</code> looks like this:</p>

<pre><code>[['id' =&gt; 80, 'type' = &gt;'X', numbers =&gt; {12,13,14,15,16}],
       ['id' =&gt; 81, 'type' = &gt;'Y',numbers =&gt; {20,21,22,23,24}]]
</code></pre>