Set Matrix Zeroes
Hard · rating 1750 · Matrix
The first line has r and c. The next r lines each have c integers. If a cell is 0, set its entire row and column to 0. Print the resulting matrix, one row per line.
Constraints: 1 ≤ r, c ≤ 500
Related problems
- Minimum Path Sum — Hard
- Treasure Grid — Hard
- Maximal Square — Hard
- Spiral Order — Medium
- Rotate Matrix 90° — Medium
- Boustrophedon Seat — Medium