weiren1998 / weiren1998.github.io

This is my blog.
1 stars 0 forks source link

面试金典0108 零矩阵 | J球星的博客 #11

Open weiren1998 opened 2 years ago

weiren1998 commented 2 years ago

https://weiren1998.github.io/archives/8c04a153.html

题目:

编写一种算法,若M × N矩阵中某个元素为0,则将其所在的行与列清零。 123456789101112131415161718192021222324252627# 样例1输入:[ [1,1,1], [1,0,1], [1,1,1]]输出:[ [1,0,1], [0,0,0], [1,0,1]] # 样例2输入:[ [0,1,2,0], [3,4,5,2],