Hello. I have some String[] arrays, for example:
['a1', 'a2']
['b1', 'b2', 'b3', 'b4']
['c1']
How can I mix them, so that I get ['a1', 'b1', 'c1', 'a2', 'b2', 'b3', 'b4']
(0 element of a, then b, c, 1 element of a, b, c and so on)? Thanks
More accurately the resulting array must consist of the first value of the first array, then the first value of the second array, ..., the first value of the last array, the second value of the first array, ..., the second value of the last array, ..., the last value of the biggest array. If arrays are not of the same size, the smaller ones just aren't being taken into account.
Here's an illustration:
a1 a2 a3 a4
b1 b2 b3 b4 b5 b6 b7
c1 c2
d1 d2 d3 d4 d5
Combines into (brackets are just to highlight steps, so they really mean nothing):
(a1 b1 c1 d1) (a2 b2 c2 d2) (a3 b3 d3) (a4 b4 d4) (b5 d5) (b6) (b7)
Also, I'd like to combine variable number of array, not just 3 or 4