You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island doesn't have "lakes" (water inside that isn't connected to the water around the island). One cell is a square with side length 1. The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.
19
+
You are given a map in form of a two-dimensional integer grid
20
+
where 1 represents land and 0 represents water.
21
+
Grid cells are connected horizontally/vertically (not diagonally).
22
+
The grid is completely surrounded by water, and there is exactly one island
23
+
(i.e., one or more connected land cells).
24
+
25
+
The island doesn't have "lakes" (water inside that isn't connected to the water around the island).
26
+
One cell is a square with side length 1.
27
+
28
+
The grid is rectangular, width and height don't exceed 100.
29
+
Determine the perimeter of the island.
18
30
19
31
Example:
20
32
@@ -38,7 +50,6 @@ public int islandPerimeter(int[][] grid) {
@@ -1181,7 +1186,7 @@ space: O(n) or rolling array O(1)
1181
1186
1182
1187
---
1183
1188
1184
-
**82. [Find All Anagrams in a String.java](https://github.com/awangdev/LintCode/blob/master/Java/Find%20All%20Anagrams%20in%20a%20String.java)** Level: Easy Tags: [Hash Table]
1189
+
**82. [Find All Anagrams in a String.java](https://github.com/awangdev/LintCode/blob/master/Java/Find%20All%20Anagrams%20in%20a%20String.java)** Level: Easy Tags: [Hash Table, Sliding Window]
1185
1190
1186
1191
1187
1192
跟 Permutation in String 很像. 给短string p, 长string s.
@@ -1571,16 +1576,18 @@ space: O(n), O(1) rolling array
|223|[Shuffle an Array.java](https://github.com/awangdev/LintCode/blob/master/Java/Shuffle%20an%20Array.java)|Medium|Java|[Permutation]||
245
-
|224|[Find All Anagrams in a String.java](https://github.com/awangdev/LintCode/blob/master/Java/Find%20All%20Anagrams%20in%20a%20String.java)|Easy|Java|[Hash Table]||
245
+
|224|[Find All Anagrams in a String.java](https://github.com/awangdev/LintCode/blob/master/Java/Find%20All%20Anagrams%20in%20a%20String.java)|Easy|Java|[Hash Table, Sliding Window]||
**224. [Find All Anagrams in a String.java](https://github.com/awangdev/LintCode/blob/master/Java/Find%20All%20Anagrams%20in%20a%20String.java)** Level: Easy Tags: [Hash Table]
4097
+
**224. [Find All Anagrams in a String.java](https://github.com/awangdev/LintCode/blob/master/Java/Find%20All%20Anagrams%20in%20a%20String.java)** Level: Easy Tags: [Hash Table, Sliding Window]
4093
4098
4094
4099
4095
4100
跟 Permutation in String 很像. 给短string p, 长string s.
0 commit comments