Skip to content

Commit 41981b9

Browse files
authored
Update solution-php.md
1 parent 27d9292 commit 41981b9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

medium/840. Magic Squares In Grid/solution-php.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@ To determine how many `3x3` subgrids within a given grid are magic squares, we n
2525
If the helper function returns true, increment the counter `$res`.
2626

2727
# Complexity
28-
- **Time complexity**:
28+
- **Time complexity**: **$O(\text{m} \times \text{n})$** is the number of rows and (n) is the number of columns in the grid. We iterate over each possible `3x3` subgrid and check if it is a magic square.
2929

30-
`O(m×n)` is the number of rows and (n) is the number of columns in the grid. We iterate over each possible `3x3` subgrid and check if it is a magic square.
31-
32-
- **Space complexity**:
33-
34-
`O(1)`, aside from the input grid, as we use a constant amount of extra space to store the set of numbers and the sums.
30+
- **Space complexity**: $O(1)$, aside from the input grid, as we use a constant amount of extra space to store the set of numbers and the sums.
3531

3632
# Code
3733
```php

0 commit comments

Comments
 (0)