File tree 1 file changed +0
-41
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-41
lines changed Original file line number Diff line number Diff line change 6
6
import java .util .List ;
7
7
import java .util .Set ;
8
8
9
- /**
10
- * 694. Number of Distinct Islands
11
- *
12
- * Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land)
13
- * connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.
14
- * Count the number of distinct islands.
15
- * An island is considered to be the same as another if and only if
16
- * one island can be translated (and not rotated or reflected) to equal the other.
17
-
18
- Example 1:
19
-
20
- 11000
21
- 11000
22
- 00011
23
- 00011
24
-
25
- Given the above grid map, return 1.
26
-
27
- Example 2:
28
-
29
- 11011
30
- 10000
31
- 00001
32
- 11011
33
-
34
- Given the above grid map, return 3.
35
-
36
- Notice that:
37
-
38
- 11
39
- 1
40
-
41
- and
42
-
43
- 1
44
- 11
45
-
46
- are considered different island shapes, because we do not consider reflection / rotation.
47
-
48
- Note: The length of each dimension in the given grid does not exceed 50.
49
- */
50
9
public class _694 {
51
10
public static class Solution1 {
52
11
/**
You can’t perform that action at this time.
0 commit comments