Prompt: Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0’s, and return the matrix. You must do it in place.

Example:

Input: matrix = [[1,1,1],[1,0,1],[1,1,1]]
Output: [[1,0,1],[0,0,0],[1,0,1]]
Input: matrix = [[0,1,2,0],[3,4,5,2],[1,3,1,5]]
Output: [[0,0,0,0],[0,4,5,0],[0,3,1,0]]

Solution: We can solve this in-place by changing all the columns and rows to other values(either the None value or a string value is perfect because it’s not an integer value) other than 0 so there is no false transformation later in the matrix. When we loop through all of the matrix and done all the transformations needed, we can transfer the None values back to 0s. The runtime for this solution is O(m x n) where m is the row and n is the column. The space complexity is O(0) because we did not use any extra space other than the original matrix.