File tree Expand file tree Collapse file tree 1 file changed +0
-32
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +0
-32
lines changed Original file line number Diff line number Diff line change 4
4
import java .util .LinkedList ;
5
5
import java .util .List ;
6
6
7
- /**
8
- * 542. 01 Matrix
9
- *
10
- * Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.
11
-
12
- The distance between two adjacent cells is 1.
13
- Example 1:
14
- Input:
15
-
16
- 0 0 0
17
- 0 1 0
18
- 0 0 0
19
- Output:
20
- 0 0 0
21
- 0 1 0
22
- 0 0 0
23
- Example 2:
24
- Input:
25
-
26
- 0 0 0
27
- 0 1 0
28
- 1 1 1
29
- Output:
30
- 0 0 0
31
- 0 1 0
32
- 1 2 1
33
-
34
- Note:
35
- The number of elements of the given matrix will not exceed 10,000.
36
- There are at least one 0 in the given matrix.
37
- The cells are adjacent in only four directions: up, down, left and right.
38
- */
39
7
public class _542 {
40
8
41
9
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments