Avatar
swiftbot BOT 6/7/2018 3:00 PM
Author icon
omochimetaru
extension Sequence { public func flatten<T>() -> [T] where Iterator.Element : Sequence, Iterator.Element.Iterator.Element == T { return flatMap { $0 } } } let a: [[Int]] = [[2, 3], [5]] let b: [Int] = a.flatten() print(b)
Version:
swift-4.1.1-RELEASE
Output:
[2, 3, 5]
Error: