Avatar
swiftbot BOT 6/7/2018 2:27 PM
Author icon
koher
extension Sequence { public func flatten<T>() -> [T] where Element : Sequence, Element.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: