My Python Accepted Solution


  • 0
    A
            columTemp = []
            row = len(matrix)
            colum = len(matrix[0])
            for i in range(row) :
                for j in range(colum) :
                    if matrix[i][j] == 0 :
                        rowTemp.append(i)
                        columTemp.append(j)
    
            for i, val in enumerate(rowTemp) :
                for j in range(colum) :
                    matrix[val][j] = 0 
    
            for i, val in enumerate(columTemp) :
                for j in range(row) :
                    matrix[j][val] = 0

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.