tag:blogger.com,1999:blog-8522573717713847738.post4861333709792647263..comments2024-03-28T00:14:29.070-07:00Comments on Yu's Coding Garden : leetcode Question 97: Set Matrix ZerosAnonymoushttp://www.blogger.com/profile/00263085222060621782noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-8522573717713847738.post-41345767449202323012014-09-29T15:37:34.740-07:002014-09-29T15:37:34.740-07:00This comment has been removed by the author.lifelovehttps://www.blogger.com/profile/01229821913521922909noreply@blogger.comtag:blogger.com,1999:blog-8522573717713847738.post-87190795775533554152014-02-04T05:57:26.723-08:002014-02-04T05:57:26.723-08:00what if there is several 2s in the matrix?
How do ...what if there is several 2s in the matrix?<br />How do you know which 2s are from the original matrix or from your set?Anonymoushttps://www.blogger.com/profile/00263085222060621782noreply@blogger.comtag:blogger.com,1999:blog-8522573717713847738.post-88925524953772670642014-02-03T18:38:50.878-08:002014-02-03T18:38:50.878-08:00请问可否这样做:
第一次扫描全matrix,如果遇到0就把该行该列设成2,注意这时如果该列/该行有别...请问可否这样做:<br />第一次扫描全matrix,如果遇到0就把该行该列设成2,注意这时如果该列/该行有别的元素是0,那不设成2,这样扫描一遍后,就知道凡是2或0的位置就要设成0<br />第二遍再把它们都设成0<br /><br />谢谢TBloggerhttps://www.blogger.com/profile/02258258053736610126noreply@blogger.com