joined(by:)
Returns the concatenation of the elements in this sequence of sequences, inserting the separator produced by the closure between each sequence.
func joined<Separator>(by separator: (Element, Element) throws -> Separator) rethrows -> [Element.Element] where Separator : Sequence, Separator.Element == Self.Element.Element
for x in [[1, 2], [3, 4], [5, 6]].joined(by: { [100 * $0.last!, 100 * $1.first!] }) {
print(x)
}
// 1, 2, 200, 300, 3, 4, 400, 500, 5, 6