Skip to content

Commit d7ce7a4

Browse files
authored
feat: update lc problems (#3125)
1 parent b0821cc commit d7ce7a4

File tree

43 files changed

+310
-85
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+310
-85
lines changed

solution/0100-0199/0130.Surrounded Regions/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ tags:
2828
<li><strong>围绕:</strong>如果您可以用&nbsp;<code>'X'</code>&nbsp;单元格 <strong>连接这个区域</strong>,并且区域中没有任何单元格位于&nbsp;<code>board</code> 边缘,则该区域被 <code>'X'</code>&nbsp;单元格围绕。</li>
2929
</ul>
3030

31+
<p>通过将输入矩阵&nbsp;<code>board</code> 中的所有 <code>'O'</code>&nbsp;替换为 <code>'X'</code> 来 <strong>捕获被围绕的区域</strong>。</p>
32+
3133
<div class="original__bRMd">
3234
<div>
3335
<p>&nbsp;</p>

solution/0400-0499/0431.Encode N-ary Tree to Binary Tree/README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,47 @@ tags:
2626

2727
<p>&nbsp;</p>
2828

29-
<p><img src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0400-0499/0431.Encode%20N-ary%20Tree%20to%20Binary%20Tree/images/narytreebinarytreeexample.png" style="width: 500px;"></p>
29+
<p><img src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0400-0499/0431.Encode%20N-ary%20Tree%20to%20Binary%20Tree/images/narytreebinarytreeexample.png" style="width: 500px;" /></p>
3030

3131
<p>&nbsp;</p>
3232

33+
<pre>
34+
<strong>输入:</strong>root = [1,null,3,2,4,null,5,6]
35+
</pre>
36+
3337
<p>注意,上面的方法仅仅是一个例子,可能可行也可能不可行。你没有必要遵循这种形式转化,你可以自己创造和实现不同的方法。</p>
3438

35-
<p><strong>注意:</strong></p>
39+
<p>&nbsp;</p>
40+
41+
<p><strong class="example">示例 1:</strong></p>
42+
43+
<pre>
44+
<strong>输入:</strong>root = [1,null,3,2,4,null,5,6]
45+
<strong>输出:</strong>[1,null,3,2,4,null,5,6]
46+
</pre>
47+
48+
<p><strong class="example">示例 2:</strong></p>
49+
50+
<pre>
51+
<strong>输入:</strong>root = [1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]
52+
<strong>输出:</strong>[1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]
53+
</pre>
54+
55+
<p><strong class="example">示例 3:</strong></p>
56+
57+
<pre>
58+
<strong>输入:</strong>root = []
59+
<strong>输出:</strong>[]
60+
</pre>
61+
62+
<p>&nbsp;</p>
63+
64+
<p><strong>提示:</strong></p>
3665

3766
<ol>
38-
<li><code>N</code>&nbsp;的范围在 <code>[1, 1000]</code></li>
67+
<li><code>N</code>&nbsp;的范围在 <code>[1, 10<sup>4</sup>]</code></li>
68+
<li><code>0 &lt;= Node.val &lt;= 10<sup>4</sup></code></li>
69+
<li>N 叉树的高度小于等于&nbsp;<code>1000</code>。</li>
3970
<li>不要使用类成员 / 全局变量 / 静态变量来存储状态。你的编码和解码算法应是无状态的。</li>
4071
</ol>
4172

solution/0400-0499/0469.Convex Polygon/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ difficulty: 中等
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0400-0499/0469.Convex%20Polygon/README.md
55
tags:
66
- 几何
7+
- 数组
78
- 数学
89
---
910

solution/0400-0499/0469.Convex Polygon/README_EN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0400-0499/0469.Convex%20Polygon/README_EN.md
55
tags:
66
- Geometry
7+
- Array
78
- Math
89
---
910

solution/0500-0599/0536.Construct Binary Tree from String/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ comments: true
33
difficulty: 中等
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0500-0599/0536.Construct%20Binary%20Tree%20from%20String/README.md
55
tags:
6+
-
67
-
78
- 深度优先搜索
89
- 字符串

solution/0500-0599/0536.Construct Binary Tree from String/README_EN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0500-0599/0536.Construct%20Binary%20Tree%20from%20String/README_EN.md
55
tags:
6+
- Stack
67
- Tree
78
- Depth-First Search
89
- String

solution/0500-0599/0558.Logical OR of Two Binary Grids Represented as Quad-Trees/README.md

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ tags:
3535
<pre>
3636
class Node {
3737
public boolean val;
38-
    public boolean isLeaf;
39-
    public Node topLeft;
40-
    public Node topRight;
41-
    public Node bottomLeft;
42-
    public Node bottomRight;
38+
&nbsp; &nbsp; public boolean isLeaf;
39+
&nbsp; &nbsp; public Node topLeft;
40+
&nbsp; &nbsp; public Node topRight;
41+
&nbsp; &nbsp; public Node bottomLeft;
42+
&nbsp; &nbsp; public Node bottomRight;
4343
}</pre>
4444

4545
<p>我们可以按以下步骤为二维区域构建四叉树:</p>
@@ -60,9 +60,9 @@ class Node {
6060

6161
<p>它与二叉树的序列化非常相似。唯一的区别是节点以列表形式表示 <code>[isLeaf, val]</code> 。</p>
6262

63-
<p>如果 <code>isLeaf</code> 或者 <code>val</code> 的值为 True ,则表示它在列表 <code>[isLeaf, val]</code> 中的值为 <strong>1</strong> ;如果 <code>isLeaf</code> 或者 <code>val</code> 的值为 False ,则表示值为 <strong>0 </strong>。</p>
63+
<p>如果 <code>isLeaf</code> 或者 <code>val</code> 的值为 True ,则表示它在列表&nbsp;<code>[isLeaf, val]</code> 中的值为 <strong>1</strong> ;如果 <code>isLeaf</code> 或者 <code>val</code> 的值为 False ,则表示值为 <strong>0 </strong>。</p>
6464

65-
<p> </p>
65+
<p>&nbsp;</p>
6666

6767
<p><strong>示例 1:</strong></p>
6868

@@ -88,37 +88,13 @@ class Node {
8888
结果矩阵大小为 1*1,值全为 0 。
8989
</pre>
9090

91-
<p><strong>示例 3:</strong></p>
92-
93-
<pre>
94-
<strong>输入:</strong>quadTree1 = [[0,0],[1,0],[1,0],[1,1],[1,1]]
95-
, quadTree2 = [[0,0],[1,1],[1,1],[1,0],[1,1]]
96-
<strong>输出:</strong>[[1,1]]
97-
</pre>
98-
99-
<p><strong>示例 4:</strong></p>
100-
101-
<pre>
102-
<strong>输入:</strong>quadTree1 = [[0,0],[1,1],[1,0],[1,1],[1,1]]
103-
, quadTree2 = [[0,0],[1,1],[0,1],[1,1],[1,1],null,null,null,null,[1,1],[1,0],[1,0],[1,1]]
104-
<strong>输出:</strong>[[0,0],[1,1],[0,1],[1,1],[1,1],null,null,null,null,[1,1],[1,0],[1,0],[1,1]]
105-
</pre>
106-
107-
<p><strong>示例 5:</strong></p>
108-
109-
<pre>
110-
<strong>输入:</strong>quadTree1 = [[0,1],[1,0],[0,1],[1,1],[1,0],null,null,null,null,[1,0],[1,0],[1,1],[1,1]]
111-
, quadTree2 = [[0,1],[0,1],[1,0],[1,1],[1,0],[1,0],[1,0],[1,1],[1,1]]
112-
<strong>输出:</strong>[[0,0],[0,1],[0,1],[1,1],[1,0],[1,0],[1,0],[1,1],[1,1],[1,0],[1,0],[1,1],[1,1]]
113-
</pre>
114-
115-
<p> </p>
91+
<p>&nbsp;</p>
11692

11793
<p><strong>提示:</strong></p>
11894

11995
<ul>
12096
<li><code>quadTree1</code> 和 <code>quadTree2</code> 都是符合题目要求的四叉树,每个都代表一个 <code>n * n</code> 的矩阵。</li>
121-
<li><code>n == 2^x</code> ,其中 <code>0 <= x <= 9</code>.</li>
97+
<li><code>n == 2<sup>x</sup></code>&nbsp;,其中 <code>0 &lt;= x &lt;= 9</code>.</li>
12298
</ul>
12399

124100
<!-- description:end -->

solution/1400-1499/1490.Clone N-ary Tree/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Node {
5858

5959
<ul>
6060
<li>给定的 N 叉树的深度小于或等于&nbsp;<code>1000</code>。</li>
61-
<li>节点的总个数在&nbsp;<code>[0,&nbsp;10^4]</code>&nbsp;之间</li>
61+
<li>节点的总个数在&nbsp;<code>[0,&nbsp;10<sup>4</sup>]</code>&nbsp;之间</li>
6262
</ul>
6363

6464
<p>&nbsp;</p>

solution/1600-1699/1612.Check If Two Expression Trees are Equivalent/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/1600-1699/1612.Ch
55
tags:
66
-
77
- 深度优先搜索
8+
- 哈希表
89
- 二叉树
10+
- 计数
911
---
1012

1113
<!-- problem:start -->

solution/1600-1699/1612.Check If Two Expression Trees are Equivalent/README_EN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/1600-1699/1612.Ch
55
tags:
66
- Tree
77
- Depth-First Search
8+
- Hash Table
89
- Binary Tree
10+
- Counting
911
---
1012

1113
<!-- problem:start -->

0 commit comments

Comments
 (0)