text: # if element in m x n matrix is 0, its entire row and column are set to 0
  
  
  def nullifyRow(arr, row):
      for i in range(len(arr[0])):
          arr[row][i] = 0
      return arr
  
  
  def nullifyCol(arr, col):
      for i in range(len(arr)):
          arr[i][col] = 0
      return arr
  
  
  def zero_matrix(arr):
      R = len(arr)
      C = len(arr[0])
  
      row = {}
      col = {}
  
      for i in range(R):
          for j in range(C):
              if arr[i][j] == 0:
                  row[i] = True
                  col[j] = True
  
      for key in row:
          if row[key]:
              arr = nullifyRow(arr, key)
  
      for key in col:
          if col[key]:
              arr = nullifyCol(arr, key)
  
      print(arr)
  
  
  zero_matrix([[4, 3, 1], [9, 5, 0], [0, 7, 6]])
  