title: Split an array in ruby based on some condition
body: <p>I have an array named <code>@level1</code> which has a value like this:</p>
  
  <pre><code>[
    [3.1, 4],
    [3.0, 7],
    [2.1, 5],
    [2.0, 6],
    [1.9, 3]
  ]
  </code></pre>
  
  <p>I want to split this into two arrays such that the first array (<code>@arr1</code>) contains the values till <code>2.1</code> and the second array (<code>@arr2</code>) contains values after it.</p>
  
  <p>After doing that, I would reverse-sort my second array by doing something like this:</p>
  
  <pre><code>@arr2 = @arr2.sort_by { |x, _| x }.reverse
  </code></pre>
  
  <p>I would then like to merge this array to <code>@arr1</code>. Can someone help me how to split the array and then merge them together?</p>