File tree Expand file tree Collapse file tree 1 file changed +0
-19
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
- /**
3
- * 463. Island Perimeter
4
- *
5
- * You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water.
6
- * Grid cells are connected horizontally/vertically (not diagonally).
7
- * The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells).
8
- * The island doesn't have "lakes" (water inside that isn't connected to the water around the island).
9
- * One cell is a square with side length 1.
10
- * The grid is rectangular, width and height don't exceed 100. Determine the perimeter of the island.
11
2
12
- Example:
13
-
14
- [[0,1,0,0],
15
- [1,1,1,0],
16
- [0,1,0,0],
17
- [1,1,0,0]]
18
-
19
- Answer: 16
20
- Explanation: The perimeter is the 16 yellow stripes in the image below:
21
- */
22
3
public class _463 {
23
4
24
5
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments