Example:
let a = [a1, a2, a3]
let b = [b1, b2]
let c = [c1, c2, c3, c4]
I need the following result:
[a1, b1, c1, a2, b2, c2, a3, c3, c4]
a1, b1, ... - any objects of the same type
My current solution is to create mutable copies of these arrays and call popFirst
sequentially on each array in the specified order until all the arrays become empty.
But is it possible to solve this task by using inner Swift features without of iterating manually? For example like the following code:
[a, b, c].map { ... }.filter { ... }.reduce ...