I have following data:
let array1 = [[1], [2], [3]]
And I want to make it vector:
let result = [1, 2, 3]
Solution off the top of my head:
var result = [Int]()
for arrayOfArray in array1 {
for value in arrayOfArray {
result(value)
}
}
Is there more elegant way to do this ?