Whenever a cell of the matrix is 0, set every cell in its row and its column to 0. Return the new matrix. Decide which rows and columns to clear from the original matrix, not from cells you have already cleared. Do not change the input.
Example 1
Input:
set_matrix_zeroes([[1, 2, 3], [4, 0, 6], [7, 8, 9]])
Output:
[[1, 0, 3], [0, 0, 0], [7, 0, 9]]
Example 2
Input:
set_matrix_zeroes([[0, 1], [2, 3]])
Output:
[[0, 0], [0, 3]]
0 <= rows, cols, and rows * cols <= 250000-10**9 <= matrix[i][j] <= 10**9No results yet
Run your code to check it against the examples, or submit to run every test.