title: How to organize elements in array by their level?
body: <p>For example, an array like this:</p>
  <pre><code>[1,2,2,3,4,1,2,3,4,1,1]
  </code></pre>
  <p>The value of each element is considered as its level.</p>
  <p>Now I want to get an array like this:</p>
  <pre><code>[
    1: [2, 2: [3: [4]]],
    1: [2: [3: [4]]],
    1,
    1
  ]
  </code></pre>
  <p>The real elements are not a number, you can consider them as objects which have a property that can contain an array of their class.</p>