I have an array like the following
[ [[0, :a], [2, :b]], [3, :c], [4, :d], [[5, :e], [6, :f], [7, :g]] ]
That is, an Array of elements
One way to do is:
array.flatten.each_slice(2).to_a