class Solution(object):
def setZeroes(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: void Do not return anything, modify matrix in-place instead.
"""
height = len(matrix)
if(height ==0): return
width = len(matrix[0])
for i in range(height):
for j in range(width):
if matrix[i][j] == 0:
for tmp in range(height):
if matrix[tmp][j] != 0:
matrix[tmp][j] = 'a'
for tmp in range(width):
if matrix[i][tmp] != 0:
matrix[i][tmp] = 'a'
for i in range(height):
for j in range(width):
if matrix[i][j] == 'a':
matrix[i][j] = 0
https://leetcode.com/problems/set-matrix-zeroes/#/solutions