Skip to content

Commit 3be2569

Browse files
committed
fix: update descriptions
1 parent fa68f43 commit 3be2569

File tree

7 files changed

+46
-3
lines changed

7 files changed

+46
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
URL: [840. Magic Squares In Grid
2+
](https://leetcode.com/problems/magic-squares-in-grid/description/)
3+
4+
A `3 x 3` magic square is a `3 x 3` grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum.
5+
6+
Given a `row x col` `grid` of integers, how many `3 x 3` contiguous magic square subgrids are there?
7+
8+
Note: while a magic square can only contain numbers from 1 to 9, grid may contain numbers up to 15.
9+
10+
![img.png](img.png)
11+
12+
**Example 1:**
13+
14+
15+
- Input: `grid = [[4,3,8,4],[9,5,1,9],[2,7,6,2]]`
16+
- Output: 1
17+
- Explanation: The following subgrid is a `3 x 3` magic square:
18+
19+
![img_1.png](img_1.png)
20+
21+
while this one is not:
22+
23+
![img_2.png](img_2.png)
24+
-
25+
In total, there is only one magic square inside the given grid.
26+
27+
**Example 2:**
28+
29+
> Input: `grid = [[8]]`
30+
>
31+
> Output: `0`
32+
33+
34+
**Constraints:**
35+
36+
- `row == grid.length`
37+
- `col == grid[i].length`
38+
- `1 <= row, col <= 10`
39+
- `0 <= grid[i][j] <= 15`
12.2 KB
Loading
10.7 KB
Loading
10.7 KB
Loading

medium/885. Spiral Matrix III/description.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,23 @@ Return an array of coordinates representing the positions of the grid in the ord
1111

1212
Example 1:
1313

14+
![img.png](img.png)
15+
1416
> **Input:** rows = 1, cols = 4, rStart = 0, cStart = 0
1517
>
1618
> **Output:** [[0,0],[0,1],[0,2],[0,3]]
1719
1820
Example 2:
1921

22+
![img_1.png](img_1.png)
23+
2024
> **Input:** rows = 5, cols = 6, rStart = 1, cStart = 4
2125
>
2226
> **Output:** [[1,4],[1,5],[2,5],[2,4],[2,3],[1,3],[0,3],[0,4],[0,5],[3,5],[3,4],[3,3],[3,2],[2,2],[1,2],[0,2],[4,5],[4,4],[4,3],[4,2],[4,1],[3,1],[2,1],[1,1],[0,1],[4,0],[3,0],[2,0],[1,0],[0,0]]
2327
2428

2529
Constraints:
2630

27-
- 1 <= rows, cols <= 100
28-
- 0 <= rStart < rows
29-
- 0 <= cStart < cols
31+
- `1 <= rows, cols <= 100`
32+
- `0 <= rStart < rows`
33+
- `0 <= cStart < cols`

medium/885. Spiral Matrix III/img.png

2.7 KB
Loading
6.42 KB
Loading

0 commit comments

Comments
 (0)