Find maximum submatrix size .
for i in range ( 0 , C ) : NEW_LINE INDENT ans = max ( ans , b [ i ] * ( C - i ) ) NEW_LINE DEDENT return ans NEW_LINE def findMax1s ( mat ) : NEW_LINE ryt = [ [ 0 for i in range ( C + 2 ) ] for j in range ( R + 2 ) ] NEW_LINE dwn = [ [ 0 for i in range ( C + 2 ) ] for j in range ( R + 2 ) ] NEW_LINE precompute ( mat , ryt , dwn ) NEW_LINE