CodeOath
← All problems

Set Matrix Zeroes

Medium
matrix

Given an m x n matrix, for every cell that's 0, set its entire row and column to 0. Return the resulting matrix.

Example:

Input: matrix = [[1,1,1],[1,0,1],[1,1,1]]
Output: [[1,0,1],[0,0,0],[1,0,1]]