Skip to content

Commit 574a854

Browse files
authored
feat: update lc problems (doocs#2099)
1 parent df32703 commit 574a854

File tree

22 files changed

+86
-105
lines changed

22 files changed

+86
-105
lines changed

solution/0000-0099/0038.Count and Say/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ countAndSay(4) = 读 "21" = 一 个 2 + 一 个 1 = "12" + "11" = "1211"
7373

7474
**方法一: 模拟**
7575

76-
题目要求输出第 $n$ 项的外观序列,而第 $n$ 项是序列中第 $n-1$ 项的描述。所以我们遍历 $n-1$ 次,每次迭代用快慢指针j和i,分别记录当前字符的位置以及下一个不等于当前字符的位置,更新上一项的序列为 $j-i$ 个当前字符。
76+
题目要求输出第 $n$ 项的外观序列,而第 $n$ 项是序列中第 $n-1$ 项的描述。所以我们遍历 $n-1$ 次,每次迭代用快慢指针 j 和 i,分别记录当前字符的位置以及下一个不等于当前字符的位置,更新上一项的序列为 $j-i$ 个当前字符。
7777

7878
时间复杂度:
7979

solution/0200-0299/0274.H-Index/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<p>给你一个整数数组 <code>citations</code> ,其中 <code>citations[i]</code> 表示研究者的第 <code>i</code> 篇论文被引用的次数。计算并返回该研究者的 <strong><code>h</code><em>&nbsp;</em>指数</strong>。</p>
1010

11-
<p>根据维基百科上&nbsp;<a href="https://baike.baidu.com/item/h-index/3991452?fr=aladdin" target="_blank">h 指数的定义</a>:<code>h</code> 代表“高引用次数” ,一名科研人员的 <code>h</code><strong> 指数 </strong>是指他(她)至少发表了 <code>h</code> 篇论文,并且每篇论文<strong> 至少</strong> 被引用 <code>h</code> 。如果 <code>h</code><em> </em>有多种可能的值,<strong><code>h</code> 指数 </strong>是其中最大的那个。</p>
11+
<p>根据维基百科上&nbsp;<a href="https://baike.baidu.com/item/h-index/3991452?fr=aladdin" target="_blank">h 指数的定义</a>:<code>h</code> 代表“高引用次数” ,一名科研人员的 <code>h</code><strong> 指数 </strong>是指他(她)至少发表了 <code>h</code> 篇论文,并且&nbsp;<strong>至少&nbsp;</strong>有 <code>h</code> 篇论文被引用次数大于等于 <code>h</code> 。如果 <code>h</code><em> </em>有多种可能的值,<strong><code>h</code> 指数 </strong>是其中最大的那个。</p>
1212

1313
<p>&nbsp;</p>
1414

solution/0300-0399/0373.Find K Pairs with Smallest Sums/README_EN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<li><code>-10<sup>9</sup> &lt;= nums1[i], nums2[i] &lt;= 10<sup>9</sup></code></li>
4444
<li><code>nums1</code> and <code>nums2</code> both are sorted in <strong>non-decreasing order</strong>.</li>
4545
<li><code>1 &lt;= k &lt;= 10<sup>4</sup></code></li>
46+
<li><code>k &lt;=&nbsp;nums1.length *&nbsp;nums2.length</code></li>
4647
</ul>
4748

4849
## Solutions

solution/0500-0599/0511.Game Play Analysis I/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<p>&nbsp;</p>
2626

27-
<p>查询每位玩家 <strong>第一次登陆平台的日期</strong>。</p>
27+
<p>查询每位玩家 <strong>第一次登录平台的日期</strong>。</p>
2828

2929
<p>查询结果的格式如下所示:</p>
3030

solution/0500-0599/0598.Range Addition II/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# [598. 范围求和 II](https://leetcode.cn/problems/range-addition-ii)
1+
# [598. 区间加法 II](https://leetcode.cn/problems/range-addition-ii)
22

33
[English Version](/solution/0500-0599/0598.Range%20Addition%20II/README_EN.md)
44

55
## 题目描述
66

77
<!-- 这里写题目描述 -->
88

9-
<p>给你一个 <code>m x&nbsp;n</code> 的矩阵&nbsp;<code>M</code><strong>&nbsp;</strong>,初始化时所有的 <code>0</code> 和一个操作数组 <code>op</code> ,其中 <code>ops[i] = [ai, bi]</code> 意味着当所有的 <code>0 &lt;= x &lt; ai</code> 和 <code>0 &lt;= y &lt; bi</code> 时, <code>M[x][y]</code> 应该加 1。</p>
9+
<p>给你一个 <code>m x&nbsp;n</code> 的矩阵&nbsp;<code>M</code><strong> </strong>和一个操作数组 <code>op</code> 。矩阵初始化时所有的单元格都为 <code>0</code> <code>ops[i] = [ai, bi]</code> 意味着当所有的 <code>0 &lt;= x &lt; ai</code> 和 <code>0 &lt;= y &lt; bi</code> 时, <code>M[x][y]</code> 应该加 1。</p>
1010

1111
<p>在&nbsp;<em>执行完所有操作后</em>&nbsp;,计算并返回&nbsp;<em>矩阵中最大整数的个数</em>&nbsp;。</p>
1212

solution/0600-0699/0663.Equal Tree Partition/README.md

Lines changed: 18 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,33 @@
66

77
<!-- 这里写题目描述 -->
88

9-
<p>给定一棵有 <code>n</code> 个结点的二叉树,你的任务是检查是否可以通过去掉树上的一条边将树分成两棵,且这两棵树结点之和相等。</p>
10-
11-
<p><strong>样例 1:</strong></p>
12-
13-
<pre><strong>输入:</strong>
14-
5
15-
/ \
16-
10 10
17-
/ \
18-
2 3
19-
20-
<strong>输出:</strong> True
21-
<strong>解释:</strong>
22-
5
23-
/
24-
10
25-
26-
和: 15
27-
28-
10
29-
/ \
30-
2 3
31-
32-
和: 15
33-
</pre>
9+
<p>给你一棵二叉树的根节点 <code>root</code>,如果你可以通过去掉原始树上的一条边将树分成两棵节点值之和相等的子树,则返回 <code>true</code>。</p>
3410

3511
<p>&nbsp;</p>
3612

37-
<p><strong>样例 2:</strong></p>
38-
39-
<pre><strong>输入:</strong>
40-
1
41-
/ \
42-
2 10
43-
/ \
44-
2 20
13+
<p><strong class="example">示例 1:</strong></p>
14+
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0600-0699/0663.Equal%20Tree%20Partition/images/split1-tree.jpg" style="width: 500px; height: 204px;" />
15+
<pre>
16+
<strong>输入:</strong>root = [5,10,10,null,null,2,3]
17+
<strong>输出:</strong>true
18+
</pre>
4519

46-
<strong>输出:</strong> False
47-
<strong>解释:</strong> 无法通过移除一条树边将这棵树划分成结点之和相等的两棵子树。
20+
<p><strong class="example">示例 2:</strong></p>
21+
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0600-0699/0663.Equal%20Tree%20Partition/images/split2-tree.jpg" style="width: 277px; height: 302px;" />
22+
<pre>
23+
<strong>输入:</strong>root = [1,2,10,null,null,2,20]
24+
<strong>输出:</strong>false
25+
<strong>解释:</strong>在树上移除一条边无法将树分成两棵节点值之和相等的子树。
4826
</pre>
4927

5028
<p>&nbsp;</p>
5129

52-
<p><strong>注释 :</strong></p>
30+
<p><strong>提示:</strong></p>
5331

54-
<ol>
55-
<li>树上结点的权值范围 [-100000, 100000]。</li>
56-
<li>1 &lt;= n &lt;= 10000</li>
57-
</ol>
58-
59-
<p>&nbsp;</p>
32+
<ul>
33+
<li>树中节点数目在 <code>[1, 10<sup>4</sup>]</code> 范围内。</li>
34+
<li><code>-10<sup>5</sup> &lt;= Node.val &lt;= 10<sup>5</sup></code></li>
35+
</ul>
6036

6137
## 解法
6238

solution/0800-0899/0840.Magic Squares In Grid/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<p><strong>示例 2:</strong></p>
3131

3232
<pre>
33-
<strong>输出:</strong> grid = [[8]]
34-
<strong>输入:</strong> 0
33+
<strong>输入:</strong> grid = [[8]]
34+
<strong>输出:</strong> 0
3535
</pre>
3636

3737
<p>&nbsp;</p>

solution/1200-1299/1206.Design Skiplist/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212

1313
<p>例如,一个跳表包含 <code>[30, 40, 50, 60, 70, 90]</code> ,然后增加 <code>80</code>、<code>45</code> 到跳表中,以下图的方式操作:</p>
1414

15-
<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1206.Design%20Skiplist/images/1506_skiplist.gif" /><br />
16-
<small>Artyom Kalinin [CC BY-SA 3.0], via <a href="https://commons.wikimedia.org/wiki/File:Skip_list_add_element-en.gif" target="_blank" title="Artyom Kalinin [CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons">Wikimedia Commons</a></small></p>
15+
<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1206.Design%20Skiplist/images/1702370216-mKQcTt-1506_skiplist.gif" style="width: 500px; height: 173px;" /></p>
1716

1817
<p>跳表中有很多层,每一层是一个短的链表。在第一层的作用下,增加、删除和搜索操作的时间复杂度不超过 <code>O(n)</code>。跳表的每一个操作的平均时间复杂度是 <code>O(log(n))</code>,空间复杂度是 <code>O(n)</code>。</p>
1918

20-
<p>了解更多 :&nbsp;<a href="https://en.wikipedia.org/wiki/Skip_list" target="_blank">https://en.wikipedia.org/wiki/Skip_list</a></p>
19+
<p>了解更多 :&nbsp;<a href="https://oi-wiki.org/ds/skiplist/" target="_blank">https://oi-wiki.org/ds/skiplist/</a></p>
2120

2221
<p>在本题中,你的设计应该要包含这些函数:</p>
2322

solution/1200-1299/1222.Queens That Can Attack the King/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Description
66

7-
<p>On a <strong>0-indexed</strong> <code>8 x 8</code> chessboard, there can be multiple black queens ad one white king.</p>
7+
<p>On a <strong>0-indexed</strong> <code>8 x 8</code> chessboard, there can be multiple black queens and one white king.</p>
88

99
<p>You are given a 2D integer array <code>queens</code> where <code>queens[i] = [xQueen<sub>i</sub>, yQueen<sub>i</sub>]</code> represents the position of the <code>i<sup>th</sup></code> black queen on the chessboard. You are also given an integer array <code>king</code> of length <code>2</code> where <code>king = [xKing, yKing]</code> represents the position of the white king.</p>
1010

solution/2500-2599/2533.Number of Good Binary Strings/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</li>
1818
<li>The size of each block of consecutive <code>0</code>&#39;s is a multiple of <code>zeroGroup</code>.
1919
<ul>
20-
<li>For example, in a binary string <code><u>00</u>11<u>0</u>1111<u>00</u></code> sizes of each block of consecutive ones are <code>[2,1,2]</code>.</li>
20+
<li>For example, in a binary string <code><u>00</u>11<u>0</u>1111<u>00</u></code> sizes of each block of consecutive zeros are <code>[2,1,2]</code>.</li>
2121
</ul>
2222
</li>
2323
</ul>

0 commit comments

Comments
 (0)