LogIn
I don't have account.

Set Matrix Zeroes

DevSniper
155 Views

Given an m x n integer matrix, Your task is to make all row and column element of the matrix 0 if any one element of that row and column is 0.

Example 1
DevBrainiac Web Image

Input : [[1,3,8], [3,4,0], [0,5,2]]

Output : [[0,3,0], [0,0,0], [0,0,0]]

Example 2
DevBrainiac Web Image
Example 3 :-
DevBrainiac Web Image