My Blog List

[Leetcode Solution] Set Matrix Zeroes

Analysis 

  • Use the first row and first column to store if corresponding row or column contain '0'
  • Details need attention. First column and first row has one overlapping so use one more variable to store it
  • After using first row to store meta data, the first row itself could be changed. So first record the original state of the first row, then use it to store meta data

Note

Code


No comments:

Post a Comment

Enter you comment