title: Convert a hash into an array
body: <p>I am trying to create a method that will take a hash:</p>
  
  <pre><code>{"H"=&gt; 1, "e"=&gt; 1, "l"=&gt; 3, "o"=&gt; 2, "W"=&gt; 1, "r"=&gt; 1, "d"=&gt; 1}
  </code></pre>
  
  <p>as a parameter and return an array of its key-value pairs like such:</p>
  
  <pre><code>arr = [["H", 1], ["e", 1], ..., ["d", 1]]
  </code></pre>
  
  <p>I have the following, but it is flawed:</p>
  
  <pre><code>def toCountsArray(counts)
    arr = []
    i = 0
    counts.each do |key, value|
      arr[i].push [key, value]
      i += 1
    end
    return arr
  end
  </code></pre>
  
  <p>I am not supposed to use the <code>to_a</code> method or any kind of helper like that. Any help or guidance is appreciated.</p>