Day2: (Arrays)
def setZeroes(self, matrix: List[List[int]]) -> None:
"""
Do not return anything, modify matrix in-place instead.
"""
rows = []
columna = []
for i in range(0 , len(matrix)):
for j in range(0 , len(matrix[i])):
if matrix[i][j] == 0:
if i not in rows:
rows.append(i)
if j not in columna:
columna.append(j)
print (rows, columna)
for i in rows:
for j in range(0 , len(matrix[i])):
matrix[i][j] = 0
for i in columna:
for j in range(0 , len(matrix)):
matrix[j][i] = 0Last updated