@@ -0,0 +1,1248 @@
+class Solution:%0A    # @param matrix, a list of lists of integers%0A    # RETURN NOTHING, MODIFY matrix IN PLACE.%0A    def setZeroes(self, matrix):%0A        firstRowZero = False%0A        firstColZero = False%0A        rows = len(matrix)%0A        cols = len(matrix%5B0%5D)%0A        %0A        for i in xrange(rows):%0A            if matrix%5Bi%5D%5B0%5D == 0:%0A                firstColZero = True%0A                break%0A        %0A        for i in xrange(cols):%0A            if matrix%5B0%5D%5Bi%5D == 0:%0A                firstRowZero = True%0A                break%0A            %0A        for i in xrange(1, rows):%0A            for j in xrange(1, cols):%0A                if matrix%5Bi%5D%5Bj%5D == 0:%0A                    matrix%5Bi%5D%5B0%5D = 0%0A                    matrix%5B0%5D%5Bj%5D = 0%0A        %0A        for i in xrange(1, rows):%0A            if matrix%5Bi%5D%5B0%5D == 0:%0A                for j in xrange(1, cols):%0A                    matrix%5Bi%5D%5Bj%5D = 0%0A                    %0A        for i in xrange(1, cols):%0A            if matrix%5B0%5D%5Bi%5D == 0:%0A                for j in xrange(1, rows):%0A                    matrix%5Bj%5D%5Bi%5D = 0%0A        %0A        if firstRowZero:%0A            for i in xrange(cols):%0A                matrix%5B0%5D%5Bi%5D = 0%0A        %0A        if firstColZero:%0A            for i in xrange(rows):%0A                matrix%5Bi%5D%5B0%5D = 0%0A

set martix