Is there a way to make these loops in one line of code or shorter form?
var matrix : [[Int]] = [
[0,1,2,9],
[3,4,5,2],
[1,3,1,5]
]
for i in rowIndexes
{
for c in 0..<nCol
{
matrix[i][c] = 0
}
}
output : [[Int]] = [
[0,0,0,0],
[3,4,5,2],
[1,3,1,5]
]