Skip to content

Commit 9973377

Browse files
committed
整理1020
1 parent 1f4e426 commit 9973377

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

docs/1020-number-of-enclaves.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ A move consists of walking from one land square 4-directionally to another land
99

1010
Return the number of land squares in the grid for which we *cannot* walk off the boundary of the grid in any number of moves.
1111

12-
1312

1413
*Example 1:*
1514

15+
image::images/1020-01.jpg[{image_attr}]
16+
1617
[subs="verbatim,quotes,macros"]
1718
----
1819
*Input:* [[0,0,0,0],[1,0,1,0],[0,1,1,0],[0,0,0,0]]
@@ -23,6 +24,8 @@ There are three 1s that are enclosed by 0s, and one 1 that isn't enclosed becaus
2324

2425
*Example 2:*
2526

27+
image::images/1020-02.jpg[{image_attr}]
28+
2629
[subs="verbatim,quotes,macros"]
2730
----
2831
*Input:* [[0,1,1,0],[0,0,1,0],[0,0,1,0],[0,0,0,0]]
@@ -32,17 +35,15 @@ All 1s are either on the boundary or can reach the boundary.
3235
3336
----
3437

35-
3638

3739
*Note:*
3840

39-
4041
. `1 <= A.length <= 500`
4142
. `1 <= A[i].length <= 500`
4243
. `0 <= A[i][j] <= 1`
4344
. All rows have the same size.
4445

45-
46+
== 思路分析
4647

4748
[[src-1020]]
4849
[{java_src_attr}]

docs/images/1020-01.jpg

14.5 KB
Loading

docs/images/1020-02.jpg

14.5 KB
Loading
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.diguage.algo.leetcode;
2+
3+
public class _1020_NumberOfEnclaves {
4+
// tag::answer[]
5+
/**
6+
* @author D瓜哥 · https://www.diguage.com
7+
* @since 2024-07-12 14:37:26
8+
*/
9+
public int numEnclaves(int[][] grid) {
10+
return 0;
11+
}
12+
// end::answer[]
13+
}

0 commit comments

Comments
 (0)