File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change
1
+ # 01 Matrix(01 矩阵)
2
+
3
+ LeetCode 542
4
+
5
+ - [ 英文版] ( https://leetcode.com/problems/01-matrix/ )
6
+
7
+ - [ 中文版] ( https://leetcode.com/problems/01-matrix/ )
8
+
9
+ ## 题目
10
+ 给定一个由 0 和 1 组成的矩阵,找出每个元素到最近的 0 的距离。
11
+
12
+ 两个相邻元素间的距离为 1 。
13
+
14
+ 示例 1:
15
+ ```
16
+ 输入:
17
+
18
+ 0 0 0
19
+ 0 1 0
20
+ 0 0 0
21
+ 输出:
22
+
23
+ 0 0 0
24
+ 0 1 0
25
+ 0 0 0
26
+ ```
27
+
28
+ 示例 2:
29
+ ```
30
+ 输入:
31
+
32
+ 0 0 0
33
+ 0 1 0
34
+ 1 1 1
35
+ 输出:
36
+
37
+ 0 0 0
38
+ 0 1 0
39
+ 1 2 1
40
+ ```
41
+
42
+ 注意:
43
+
44
+ 1 . 给定矩阵的元素个数不超过 10000。
45
+ 2 . 给定矩阵中至少有一个元素是 0。
46
+ 3 . 矩阵中的元素只在四个方向上相邻: 上、下、左、右。
47
+
48
+ ## 思路
49
+ <details >
50
+ <summary >点击展开</summary >
51
+ // TODO
52
+ </details >
53
+
54
+ ## 代码实现
55
+ | C | C++ | Java | Objective-C | Swift | Python | JavaScript | Go | PHP |
56
+ | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: |
57
+ | 🤔 | 🤔 | 🤔 | 🤔 | 🤔 | 🤔 | 🤔 | 🤔 | 🤔 |
58
+
Original file line number Diff line number Diff line change 11
11
[ 05. Search in Rotated Sorted Array(搜索旋转排序数组)] ( ./05.SearchInRotatedArray )
12
12
13
13
[ 06. Search a 2D Matrix(搜索二维矩阵)] ( ./06.SearchA2DMatrix )
14
+
15
+ [ 07. Matrix(01 矩阵)] ( ./07.01Matrix )
You can’t perform that action at this time.
0 commit comments