Skip to content

Commit 5ded9f3

Browse files
authored
feat: update lc problems (#4523)
1 parent 90f466e commit 5ded9f3

File tree

74 files changed

+358
-197
lines changed

Some content is hidden

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

74 files changed

+358
-197
lines changed

solution/0000-0099/0049.Group Anagrams/README.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,41 @@ tags:
1919

2020
<!-- description:start -->
2121

22-
<p>给你一个字符串数组,请你将 <strong>字母异位词</strong> 组合在一起。可以按任意顺序返回结果列表。</p>
23-
24-
<p><strong>字母异位词</strong> 是由重新排列源单词的所有字母得到的一个新单词。</p>
22+
<p>给你一个字符串数组,请你将 <span data-keyword="anagram">字母异位词</span> 组合在一起。可以按任意顺序返回结果列表。</p>
2523

2624
<p>&nbsp;</p>
2725

2826
<p><strong>示例 1:</strong></p>
2927

30-
<pre>
31-
<strong>输入:</strong> strs = <code>["eat", "tea", "tan", "ate", "nat", "bat"]</code>
32-
<strong>输出: </strong>[["bat"],["nat","tan"],["ate","eat","tea"]]</pre>
28+
<div class="example-block">
29+
<p><strong>输入:</strong> strs = ["eat", "tea", "tan", "ate", "nat", "bat"]</p>
30+
31+
<p><strong>输出: </strong>[["bat"],["nat","tan"],["ate","eat","tea"]]</p>
32+
33+
<p><strong>解释:</strong></p>
34+
35+
<ul>
36+
<li>在 strs 中没有字符串可以通过重新排列来形成 <code>"bat"</code>。</li>
37+
<li>字符串 <code>"nat"</code> 和 <code>"tan"</code> 是字母异位词,因为它们可以重新排列以形成彼此。</li>
38+
<li>字符串 <code>"ate"</code>&nbsp;,<code>"eat"</code>&nbsp;和 <code>"tea"</code> 是字母异位词,因为它们可以重新排列以形成彼此。</li>
39+
</ul>
40+
</div>
3341

3442
<p><strong>示例 2:</strong></p>
3543

36-
<pre>
37-
<strong>输入:</strong> strs = <code>[""]</code>
38-
<strong>输出: </strong>[[""]]
39-
</pre>
44+
<div class="example-block">
45+
<p><strong>输入:</strong> strs = [""]</p>
46+
47+
<p><strong>输出: </strong>[[""]]</p>
48+
</div>
4049

4150
<p><strong>示例 3:</strong></p>
4251

43-
<pre>
44-
<strong>输入:</strong> strs = <code>["a"]</code>
45-
<strong>输出: </strong>[["a"]]</pre>
52+
<div class="example-block">
53+
<p><strong>输入:</strong> strs = ["a"]</p>
54+
55+
<p><strong>输出: </strong>[["a"]]</p>
56+
</div>
4657

4758
<p>&nbsp;</p>
4859

solution/0000-0099/0066.Plus One/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ tags:
1717

1818
<!-- description:start -->
1919

20-
<p>给定一个由 <strong>整数 </strong>组成的<strong> 非空</strong> 数组所表示的非负整数,在该数的基础上加一。</p>
20+
<p>给定一个表示 <strong>大整数</strong> 的整数数组 <code>digits</code>,其中 <code>digits[i]</code> 是整数的第 <code>i</code> 位数字。这些数字按从左到右,从最高位到最低位排列。这个大整数不包含任何前导 <code>0</code>。</p>
2121

22-
<p>最高位数字存放在数组的首位, 数组中每个元素只存储<strong>单个</strong>数字。</p>
23-
24-
<p>你可以假设除了整数 0 之外,这个整数不会以零开头。</p>
22+
<p>将大整数加 1,并返回结果的数字数组。</p>
2523

2624
<p>&nbsp;</p>
2725

@@ -31,6 +29,8 @@ tags:
3129
<strong>输入:</strong>digits = [1,2,3]
3230
<strong>输出:</strong>[1,2,4]
3331
<strong>解释:</strong>输入数组表示数字 123。
32+
加 1 后得到 123 + 1 = 124。
33+
因此,结果应该是 [1,2,4]。
3434
</pre>
3535

3636
<p><strong>示例&nbsp;2:</strong></p>
@@ -39,6 +39,8 @@ tags:
3939
<strong>输入:</strong>digits = [4,3,2,1]
4040
<strong>输出:</strong>[4,3,2,2]
4141
<strong>解释:</strong>输入数组表示数字 4321。
42+
加 1 后得到 4321 + 1 = 4322。
43+
因此,结果应该是 [4,3,2,2]。
4244
</pre>
4345

4446
<p><strong>示例 3:</strong></p>
@@ -58,6 +60,7 @@ tags:
5860
<ul>
5961
<li><code>1 &lt;= digits.length &lt;= 100</code></li>
6062
<li><code>0 &lt;= digits[i] &lt;= 9</code></li>
63+
<li><code>digits</code>&nbsp;不包含任何前导 <code>0</code>。</li>
6164
</ul>
6265

6366
<!-- description:end -->

solution/0200-0299/0228.Summary Ranges/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ tags:
1818

1919
<p>给定一个 &nbsp;<strong>无重复元素</strong> 的&nbsp;<strong>有序</strong> 整数数组 <code>nums</code> 。</p>
2020

21-
<p>返回 <em><strong>恰好覆盖数组中所有数字</strong> 的 <strong>最小有序</strong> 区间范围列表&nbsp;</em>。也就是说,<code>nums</code> 的每个元素都恰好被某个区间范围所覆盖,并且不存在属于某个范围但不属于 <code>nums</code> 的数字 <code>x</code> 。</p>
21+
<p>区间 <code>[a,b]</code> 是从 <code>a</code> 到 <code>b</code>(包含)的所有整数的集合。</p>
22+
23+
<p>返回 <em><strong>恰好覆盖数组中所有数字</strong> 的 <strong>最小有序</strong> 区间范围列表&nbsp;</em>。也就是说,<code>nums</code> 的每个元素都恰好被某个区间范围所覆盖,并且不存在属于某个区间但不属于 <code>nums</code> 的数字 <code>x</code> 。</p>
2224

2325
<p>列表中的每个区间范围 <code>[a,b]</code> 应该按如下格式输出:</p>
2426

solution/0200-0299/0250.Count Univalue Subtrees/README.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,42 @@ tags:
1818

1919
<!-- description:start -->
2020

21-
<p>给定一个二叉树,统计该二叉树数值相同的<span data-keyword="subtree">子树</span>个数。</p>
21+
<p>给定一个二叉树,统计该二叉树数值相同的 <span data-keyword="subtree">子树</span> 个数。</p>
2222

2323
<p>同值子树是指该子树的所有节点都拥有相同的数值。</p>
2424

25-
<p><strong>示例:</strong></p>
25+
<p>&nbsp;</p>
2626

27+
<p><strong class="example">示例 1:</strong></p>
28+
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0200-0299/0250.Count%20Univalue%20Subtrees/images/unival_e1.jpg" style="width: 450px; height: 258px;" />
2729
<pre>
28-
<strong>输入: </strong>root = [5,1,5,5,5,null,5]
30+
<strong>输入:</strong>root = [5,1,5,5,5,null,5]
31+
<b>输出:</b>4
32+
</pre>
2933

30-
5
31-
/ \
32-
1 5
33-
/ \ \
34-
5 5 5
34+
<p><strong class="example">示例 2:</strong></p>
3535

36-
<strong>输出:</strong> 4
36+
<pre>
37+
<b>输入:</b>root = []
38+
<b>输出:</b>0
3739
</pre>
3840

41+
<p><strong class="example">示例 3:</strong></p>
42+
43+
<pre>
44+
<b>输入:</b>root = [5,5,5,5,5,null,5]
45+
<b>输出:</b>6
46+
</pre>
47+
48+
<p>&nbsp;</p>
49+
50+
<p><strong>提示:</strong></p>
51+
52+
<ul>
53+
<li>树中节点的编号在 <code>[0, 1000]</code>&nbsp;范围内</li>
54+
<li><code>-1000 &lt;= Node.val &lt;= 1000</code></li>
55+
</ul>
56+
3957
<!-- description:end -->
4058

4159
## 解法

solution/0300-0399/0328.Odd Even Linked List/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ tags:
1616

1717
<!-- description:start -->
1818

19-
<p>给定单链表的头节点&nbsp;<code>head</code>&nbsp;将所有索引为奇数的节点和索引为偶数的节点分别组合在一起,然后返回重新排序的列表。</p>
19+
<p>给定单链表的头节点&nbsp;<code>head</code>&nbsp;将所有索引为奇数的节点和索引为偶数的节点分别分组,保持它们原有的相对顺序,然后把偶数索引节点分组连接到奇数索引节点分组之后,返回重新排序的链表。</p>
2020

2121
<p><strong>第一个</strong>节点的索引被认为是 <strong>奇数</strong> , <strong>第二个</strong>节点的索引为&nbsp;<strong>偶数</strong> ,以此类推。</p>
2222

solution/0400-0499/0412.Fizz Buzz/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ tags:
1818

1919
<!-- description:start -->
2020

21-
<p>给你一个整数 <code>n</code> ,找出从 <code>1</code> 到 <code>n</code> 各个整数的 Fizz Buzz 表示,并用字符串数组 <code>answer</code>(<strong>下标从 1 开始</strong>)返回结果,其中:</p>
21+
<p>给你一个整数 <code>n</code> ,返回一个字符串数组 <code>answer</code>(<strong>下标从 1 开始</strong>),其中:</p>
2222

2323
<ul>
2424
<li><code>answer[i] == "FizzBuzz"</code> 如果 <code>i</code> 同时是 <code>3</code> 和 <code>5</code> 的倍数。</li>

solution/0400-0499/0418.Sentence Screen Fitting/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ bcd-e-
5454
<p><strong>示例 3:</strong></p>
5555

5656
<pre>
57-
<strong>输入:</strong>sentence = ["I", "had", "apple", "pie"], rows = 4, cols = 5
57+
<strong>输入:</strong>sentence = ["i", "had", "apple", "pie"], rows = 4, cols = 5
5858
<strong>输出:</strong>1
5959
<strong>解释:</strong>
60-
I-had
60+
i-had
6161
apple
62-
pie-I
62+
pie-i
6363
had--
6464
字符 '-' 表示屏幕上的一个空白位置。
6565
</pre>

solution/0500-0599/0520.Detect Capital/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ tags:
2020

2121
<ul>
2222
<li>全部字母都是大写,比如 <code>"USA"</code> 。</li>
23-
<li>单词中所有字母都不是大写,比如 <code>"leetcode"</code> 。</li>
24-
<li>如果单词不只含有一个字母,只有首字母大写,&nbsp;比如&nbsp;<code>"Google"</code> 。</li>
23+
<li>所有字母都不是大写,比如 <code>"leetcode"</code> 。</li>
24+
<li>只有首字母大写,&nbsp;比如&nbsp;<code>"Google"</code> 。</li>
2525
</ul>
2626

2727
<p>给你一个字符串 <code>word</code> 。如果大写用法正确,返回 <code>true</code> ;否则,返回 <code>false</code> 。</p>

solution/0500-0599/0550.Game Play Analysis IV/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ tags:
3232
每一行是一个玩家的记录,他在某一天使用某个设备注销之前登录并玩了很多游戏(可能是 0)。
3333
</pre>
3434

35-
<p>&nbsp;</p>
36-
37-
<p>编写解决方案,报告在首次登录的第二天再次登录的玩家的 <strong>比率</strong>,<strong>四舍五入到小数点后两位</strong>。换句话说,你需要计算从首次登录日期开始至少连续两天登录的玩家的数量,然后除以玩家总数。</p>
35+
<p>编写解决方案,报告在首次登录的第二天再次登录的玩家的 <strong>比率</strong>,<strong>四舍五入到小数点后两位</strong>。换句话说,你需要计算从首次登录后的第二天登录的玩家数量,并将其除以总玩家数。</p>
3836

3937
<p>结果格式如下所示:</p>
4038

solution/0500-0599/0550.Game Play Analysis IV/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ This table shows the activity of players of some games.
3232
Each row is a record of a player who logged in and played a number of games (possibly 0) before logging out on someday using some device.
3333
</pre>
3434

35-
<p>&nbsp;</p>
35+
<p> </p>
3636

37-
<p>Write a&nbsp;solution&nbsp;to report the <strong>fraction</strong> of players that logged in again on the day after the day they first logged in, <strong>rounded to 2 decimal places</strong>. In other words, you need to count the number of players that logged in for at least two consecutive days starting from their first login date, then divide that number by the total number of players.</p>
37+
<p>Write a solution to report the <strong>fraction</strong> of players that logged in again on the day after the day they first logged in, <strong>rounded to 2 decimal places</strong>. In other words, you need to determine the number of players who logged in on the day immediately following their initial login, and divide it by the number of total players.</p>
3838

39-
<p>The&nbsp;result format is in the following example.</p>
39+
<p>The result format is in the following example.</p>
4040

4141
<p>&nbsp;</p>
4242
<p><strong class="example">Example 1:</strong></p>

solution/0600-0699/0684.Redundant Connection/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tags:
2121

2222
<p>树可以看成是一个连通且 <strong>无环&nbsp;</strong>的&nbsp;<strong>无向&nbsp;</strong>图。</p>
2323

24-
<p>给定往一棵&nbsp;<code>n</code> 个节点 (节点值&nbsp;<code>1~n</code>) 的树中添加一条边后的图。添加的边的两个顶点包含在 <code>1</code> 到 <code>n</code>&nbsp;中间,且这条附加的边不属于树中已存在的边。图的信息记录于长度为 <code>n</code> 的二维数组 <code>edges</code>&nbsp;,<code>edges[i] = [a<sub>i</sub>, b<sub>i</sub>]</code>&nbsp;表示图中在 <code>ai</code> 和 <code>bi</code> 之间存在一条边。</p>
24+
<p>给定一个图,该图从一棵&nbsp;<code>n</code> 个节点 (节点值&nbsp;<code>1~n</code>) 的树中添加一条边后获得。添加的边的两个不同顶点编号在 <code>1</code> 到 <code>n</code>&nbsp;中间,且这条附加的边不属于树中已存在的边。图的信息记录于长度为 <code>n</code> 的二维数组 <code>edges</code>&nbsp;,<code>edges[i] = [a<sub>i</sub>, b<sub>i</sub>]</code>&nbsp;表示图中在 <code>ai</code> 和 <code>bi</code> 之间存在一条边。</p>
2525

2626
<p>请找出一条可以删去的边,删除后可使得剩余部分是一个有着 <code>n</code> 个节点的树。如果有多个答案,则返回数组&nbsp;<code>edges</code>&nbsp;中最后出现的那个。</p>
2727

solution/0600-0699/0689.Maximum Sum of 3 Non-Overlapping Subarrays/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ tags:
3131
<strong>输入:</strong>nums = [1,2,1,2,6,7,5,1], k = 2
3232
<strong>输出:</strong>[0,3,5]
3333
<strong>解释:</strong>子数组 [1, 2], [2, 6], [7, 5] 对应的起始下标为 [0, 3, 5]。
34-
也可以取 [2, 1], 但是结果 [1, 3, 5] 在字典序上更小
34+
也可以取 [2, 1], 但是结果 [1, 3, 5] 在字典序上更大
3535
</pre>
3636

3737
<p><strong class="example">示例 2:</strong></p>

solution/0600-0699/0689.Maximum Sum of 3 Non-Overlapping Subarrays/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ tags:
3030
<strong>Input:</strong> nums = [1,2,1,2,6,7,5,1], k = 2
3131
<strong>Output:</strong> [0,3,5]
3232
<strong>Explanation:</strong> Subarrays [1, 2], [2, 6], [7, 5] correspond to the starting indices [0, 3, 5].
33-
We could have also taken [2, 1], but an answer of [1, 3, 5] would be lexicographically smaller.
33+
We could have also taken [2, 1], but an answer of [1, 3, 5] would be lexicographically larger.
3434
</pre>
3535

3636
<p><strong class="example">Example 2:</strong></p>

solution/0700-0799/0704.Binary Search/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,23 @@ tags:
1717

1818
<!-- description:start -->
1919

20-
<p>给定一个&nbsp;<code>n</code>&nbsp;个元素有序的(升序)整型数组&nbsp;<code>nums</code> 和一个目标值&nbsp;<code>target</code> &nbsp;,写一个函数搜索&nbsp;<code>nums</code>&nbsp;中的 <code>target</code>,如果目标值存在返回下标,否则返回 <code>-1</code>。</p>
20+
<p>给定一个&nbsp;<code>n</code>&nbsp;个元素有序的(升序)整型数组&nbsp;<code>nums</code> 和一个目标值&nbsp;<code>target</code> &nbsp;,写一个函数搜索&nbsp;<code>nums</code>&nbsp;中的 <code>target</code>,如果&nbsp;<code>target</code> 存在返回下标,否则返回 <code>-1</code>。</p>
2121

22-
<p><br>
22+
<p>你必须编写一个具有 <code>O(log n)</code> 时间复杂度的算法。</p>
23+
24+
<p><br />
2325
<strong>示例 1:</strong></p>
2426

25-
<pre><strong>输入:</strong> <code>nums</code> = [-1,0,3,5,9,12], <code>target</code> = 9
27+
<pre>
28+
<strong>输入:</strong> <code>nums</code> = [-1,0,3,5,9,12], <code>target</code> = 9
2629
<strong>输出:</strong> 4
2730
<strong>解释:</strong> 9 出现在 <code>nums</code> 中并且下标为 4
2831
</pre>
2932

3033
<p><strong>示例&nbsp;2:</strong></p>
3134

32-
<pre><strong>输入:</strong> <code>nums</code> = [-1,0,3,5,9,12], <code>target</code> = 2
35+
<pre>
36+
<strong>输入:</strong> <code>nums</code> = [-1,0,3,5,9,12], <code>target</code> = 2
3337
<strong>输出:</strong> -1
3438
<strong>解释:</strong> 2 不存在 <code>nums</code> 中因此返回 -1
3539
</pre>

solution/0700-0799/0720.Longest Word in Dictionary/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ tags:
2020

2121
<!-- description:start -->
2222

23-
<p>给出一个字符串数组&nbsp;<code>words</code> 组成的一本英语词典。返回&nbsp;<code>words</code> 中最长的一个单词,该单词是由&nbsp;<code>words</code>&nbsp;词典中其他单词逐步添加一个字母组成。</p>
23+
<p>给出一个字符串数组&nbsp;<code>words</code> 组成的一本英语词典。返回能够通过&nbsp;<code>words</code>&nbsp;中其它单词逐步添加一个字母来构造得到的&nbsp;<code>words</code> 中最长的单词。</p>
2424

2525
<p>若其中有多个可行的答案,则返回答案中字典序最小的单词。若无答案,则返回空字符串。</p>
2626

solution/0700-0799/0797.All Paths From Source to Target/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ tags:
1919

2020
<!-- description:start -->
2121

22-
<p>给你一个有&nbsp;<code>n</code>&nbsp;个节点的 <strong>有向无环图(DAG)</strong>,请你找出所有从节点 <code>0</code>&nbsp;到节点 <code>n-1</code>&nbsp;的路径并输出(<strong>不要求按特定顺序</strong>)</p>
22+
<p>给你一个有&nbsp;<code>n</code>&nbsp;个节点的 <strong>有向无环图(DAG)</strong>,请你找出从节点 <code>0</code>&nbsp;到节点 <code>n-1</code>&nbsp;的所有路径并输出(<strong>不要求按特定顺序</strong>)</p>
2323

2424
<p><meta charset="UTF-8" />&nbsp;<code>graph[i]</code>&nbsp;是一个从节点 <code>i</code> 可以访问的所有节点的列表(即从节点 <code>i</code> 到节点&nbsp;<code>graph[i][j]</code>存在一条有向边)。</p>
2525

solution/0800-0899/0873.Length of Longest Fibonacci Subsequence/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ tags:
1818

1919
<!-- description:start -->
2020

21-
<p>如果序列 <code>X_1, X_2, ..., X_n</code> 满足下列条件,就说它是 <em>斐波那契式 </em>的:</p>
21+
<p>如果序列&nbsp;<code>x<sub>1</sub>, x<sub>2</sub>, ..., x<sub>2</sub></code>&nbsp;满足下列条件,就说它是&nbsp;<em>斐波那契式&nbsp;</em>的:</p>
2222

2323
<ul>
24-
<li><code>n >= 3</code></li>
25-
<li>对于所有 <code>i + 2 <= n</code>,都有 <code>X_i + X_{i+1} = X_{i+2}</code></li>
24+
<li><code>n &gt;= 3</code></li>
25+
<li>对于所有&nbsp;<code>i + 2 &lt;= n</code>,都有&nbsp;<code>x<sub>i</sub>&nbsp;+ x<sub>i+1</sub>&nbsp;== x<sub>i+2</sub></code></li>
2626
</ul>
2727

28-
<p>给定一个<strong>严格递增</strong>的正整数数组形成序列 arr ,找到 <font color="#c7254e"><font face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="font-size:12.600000381469727px"><span style="caret-color:#c7254e"><span style="background-color:#f9f2f4">arr</span></span></span></font></font> 中最长的斐波那契式的子序列的长度。如果一个不存在,返回  0 。</p>
28+
<p>给定一个&nbsp;<strong>严格递增&nbsp;</strong>的正整数数组形成序列 <code>arr</code>&nbsp;,找到 <code><font color="#c7254e"><font face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="font-size:12.600000381469727px"><span style="caret-color:#c7254e"><span style="background-color:#f9f2f4">arr</span></span></span></font></font></code>&nbsp;中最长的斐波那契式的子序列的长度。如果不存在,返回&nbsp;&nbsp;<code>0</code> 。</p>
2929

30-
<p><em>(回想一下,子序列是从原序列 <font color="#c7254e"><font face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="font-size:12.600000381469727px"><span style="caret-color:#c7254e"><span style="background-color:#f9f2f4">arr</span></span></span></font></font> 中派生出来的,它从 <font color="#c7254e"><font face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="font-size:12.600000381469727px"><span style="caret-color:#c7254e"><span style="background-color:#f9f2f4">arr</span></span></span></font></font> 中删掉任意数量的元素(也可以不删),而不改变其余元素的顺序。例如, <code>[3, 5, 8]</code> 是 <code>[3, 4, 5, 6, 7, 8]</code> 的一个子序列)</em></p>
30+
<p><strong>子序列</strong> 是通过从另一个序列 <code>arr</code> 中删除任意数量的元素(包括删除 0 个元素)得到的,同时不改变剩余元素顺序。例如,<code>[3, 5, 8]</code><code>[3, 4, 5, 6, 7, 8]</code>&nbsp;的子序列。</p>
3131

32-
<p> </p>
32+
<p>&nbsp;</p>
3333

3434
<ul>
3535
</ul>
@@ -42,22 +42,22 @@ tags:
4242
<strong>解释: </strong>最长的斐波那契式子序列为 [1,2,3,5,8] 。
4343
</pre>
4444

45-
<p><strong>示例 2:</strong></p>
45+
<p><strong>示例&nbsp;2:</strong></p>
4646

4747
<pre>
4848
<strong>输入: </strong>arr =<strong> </strong>[1,3,7,11,12,14,18]
4949
<strong>输出: </strong>3
5050
<strong>解释</strong>: 最长的斐波那契式子序列有 [1,11,12]、[3,11,14] 以及 [7,11,18] 。
5151
</pre>
5252

53-
<p> </p>
53+
<p>&nbsp;</p>
5454

5555
<p><strong>提示:</strong></p>
5656

5757
<ul>
58-
<li><code>3 <= arr.length <= 1000</code></li>
58+
<li><code>3 &lt;= arr.length &lt;= 1000</code></li>
5959
<li>
60-
<p><code>1 <= arr[i] < arr[i + 1] <= 10^9</code></p>
60+
<p><code>1 &lt;= arr[i] &lt; arr[i + 1] &lt;= 10<sup>9</sup></code></p>
6161
</li>
6262
</ul>
6363

0 commit comments

Comments
 (0)