I'm having trouble conceptualizing the method to accomplish this. I have two arrays, one with values only and one with arrays of values. I need to merge these into the array of values only in their intended sequential order. So for example:
Code: Select all
Arr1 := [1,4,7]
Arr2 := [[2,3],[5,6],[8,9,10]]
Arr1 should become:
Just to clarify, I'm not asking how to push all of the data to
Arr1 and sort it, the numbers are just stand ins for data that needs to be ordered in the new array. For example, the data at
[8,9,10] in
Arr2 is related to the data at
7 in
Arr1,
[5,6] to
4, etc.
My original thought was to reverse the order of
Arr2 [[8,9,10],[5,6],[2,3]] and insert the values into
Arr1 from back to front, but I'm stalling on that method. Any help is greatly appreciated.