Saloni6111 / DSA_Problems-Hacktoberfest-2024

Solve given DSA problems here for hactoberfest.
7 stars 12 forks source link

Set Matrix Zeroes #47

Open Saloni6111 opened 19 hours ago

Saloni6111 commented 19 hours ago

Description: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do this in-place.

Constraints: Use constant space if possible.

Example: Input: [[1,1,1],[1,0,1],[1,1,1]] Output: [[1,0,1],[0,0,0],[1,0,1]]