Back to DSA sheet
Set Matrix Zeroes
MediumMatrixIf an element in an m x n matrix is 0, set its entire row and column to 0, in place.
Constraints
- 1 <= m, n <= 200
- -2^31 <= matrix[i][j] <= 2^31 - 1
Sheets
Blind 75NeetCode 150NeetCode 250Striver A2Z
set-matrix-zeroes.cpp
Loading editor
Custom input (stdin)
Output
Run your code to see its output.