Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
Copied method from:http://www.programcreek.com/2012/12/leetcode-set-matrix-zeroes-java/
This problem can solve by following 4 steps:
- check if first row and column are zero or not
- mark zeros on first row and column
- use mark to set elements
- set first column and row by using marks in step 1
Becareful of first row and column