diff options
Diffstat (limited to 'count_square_submatrices_ones.py')
-rw-r--r-- | count_square_submatrices_ones.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/count_square_submatrices_ones.py b/count_square_submatrices_ones.py index 399a741..1ce43e7 100644 --- a/count_square_submatrices_ones.py +++ b/count_square_submatrices_ones.py @@ -14,7 +14,7 @@ class Solution(object): """ for i in range(1, len(matrix)): for j in range(1, len(matrix[0])): - matrix[i][j] *= ( + matrix[i][j] += ( min(matrix[i - 1][j], matrix[i][j - 1], matrix[i - 1][j - 1]) + 1 ) return sum(map(sum, matrix)) |