Skip to content

Latest commit

 

History

History
19 lines (17 loc) · 300 Bytes

README.md

File metadata and controls

19 lines (17 loc) · 300 Bytes

MatrixSetZero

Description:
实现一个函数,传入参数为一个矩阵(int型二维数组),将其中为0的行与列都置为0后返回。要求空间复杂度为O(1)

input:

1 0 2 3 1
2 3 0 1 1
2 1 1 2 4
3 0 1 1 1

output:

0 0 0 0 0
0 0 0 0 0
2 0 0 2 4
0 0 0 0 0