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
Copy file name to clipboardExpand all lines: src/main/java/com/fishercoder/solutions/_286.java
-21Lines changed: 0 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -3,27 +3,6 @@
3
3
importjava.util.LinkedList;
4
4
importjava.util.Queue;
5
5
6
-
/**
7
-
* You are given a m x n 2D grid initialized with these three possible values.
8
-
9
-
-1 - A wall or an obstacle.
10
-
0 - A gate.
11
-
INF - Infinity means an empty room. We use the value 231 - 1 = 2147483647 to represent INF as you may assume that the distance to a gate is less than 2147483647.
12
-
Fill each empty room with the distance to its nearest gate. If it is impossible to reach a gate, it should be filled with INF.
13
-
14
-
For example, given the 2D grid:
15
-
INF -1 0 INF
16
-
INF INF INF -1
17
-
INF -1 INF -1
18
-
0 -1 INF INF
19
-
20
-
After running your function, the 2D grid should be:
0 commit comments