Skip to content

Commit f1ff187

Browse files
Update largest_square_area_in_matrix.py
1 parent 25f97af commit f1ff187

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

matrix/largest_square_area_in_matrix.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Output:
1515
2
1616
17-
Explaination: The maximum size of the square
17+
Explanation: The maximum size of the square
1818
sub-matrix is 2. The matrix itself is the
1919
maximum sized sub-matrix in this case.
2020
---
@@ -26,10 +26,10 @@
2626
[0, 0]]
2727
Output: 0
2828
29-
Explaination: There is no 1 in the matrix.
29+
Explanation: There is no 1 in the matrix.
3030
3131
32-
Approch:
32+
Approach:
3333
We initialize another matrix (dp) with the same dimensions
3434
as the original one initialized with all 0’s.
3535
@@ -50,7 +50,7 @@ def largest_square_area_in_matrix_top_down_approch(
5050
Function updates the largest_square_area[0], if recursive call found
5151
square with maximum area.
5252
53-
We arent using dp_array here, so the time complexity would be exponential.
53+
We aren't using dp_array here, so the time complexity would be exponential.
5454
5555
>>> largest_square_area_in_matrix_top_down_approch(2, 2, [[1,1], [1,1]])
5656
2
@@ -126,7 +126,7 @@ def largest_square_area_in_matrix_bottom_up(
126126
rows: int, cols: int, mat: list[list[int]]
127127
) -> int:
128128
"""
129-
Function updates the largest_square_area, using bottom up approch.
129+
Function updates the largest_square_area, using bottom up approach.
130130
131131
>>> largest_square_area_in_matrix_bottom_up(2, 2, [[1,1], [1,1]])
132132
2
@@ -156,7 +156,8 @@ def largest_square_area_in_matrix_bottom_up_space_optimization(
156156
rows: int, cols: int, mat: list[list[int]]
157157
) -> int:
158158
"""
159-
Function updates the largest_square_area, using bottom up approch. with space optimization.
159+
Function updates the largest_square_area, using bottom up
160+
approach. with space optimization.
160161
161162
>>> largest_square_area_in_matrix_bottom_up_space_optimization(2, 2, [[1,1], [1,1]])
162163
2

0 commit comments

Comments
 (0)