Skip to content

Commit f3f5f24

Browse files
authored
chore: update lc problems (doocs#1590)
1 parent 408589c commit f3f5f24

File tree

53 files changed

+368
-311
lines changed

Some content is hidden

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

53 files changed

+368
-311
lines changed

solution/0100-0199/0115.Distinct Subsequences/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

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

9-
<p>给你两个字符串 <code>s</code><strong> </strong>和 <code>t</code> ,统计并返回在 <code>s</code> 的 <strong>子序列</strong> 中 <code>t</code> 出现的个数。</p>
10-
11-
<p>题目数据保证答案符合 32 位带符号整数范围。</p>
9+
<p>给你两个字符串 <code>s</code><strong> </strong>和 <code>t</code> ,统计并返回在 <code>s</code> 的 <strong>子序列</strong> 中 <code>t</code> 出现的个数,结果需要对&nbsp;10<sup>9</sup> + 7 取模。</p>
1210

1311
<p>&nbsp;</p>
1412

solution/0100-0199/0115.Distinct Subsequences/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>Given two strings <code>s</code> and <code>t</code>, return <em>the number of distinct</em> <span data-keyword="subsequence-string"><strong><em>subsequences</em></strong></span><em> of </em><code>s</code><em> which equals </em><code>t</code>.</p>
7+
<p>Given two strings s and t, return <i>the number of distinct</i> <b><i>subsequences</i></b><i> of </i>s<i> which equals </i>t.</p>
88

99
<p>The test cases are generated so that the answer fits on a 32-bit signed integer.</p>
1010

solution/0100-0199/0197.Rising Temperature/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
| recordDate | date |
1919
| temperature | int |
2020
+---------------+---------+
21-
在 SQL 中,id 是该表的主键
21+
id 是该表具有唯一值的列
2222
该表包含特定日期的温度信息</pre>
2323

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

26-
<p>找出与之前(昨天的)日期相比温度更高的所有日期的 <code>id</code> 。</p>
26+
<p>编写解决方案,找出与之前(昨天的)日期相比温度更高的所有日期的 <code>id</code> 。</p>
2727

2828
<p>返回结果 <strong>无顺序要求</strong> 。</p>
2929

solution/0100-0199/0197.Rising Temperature/README_EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
| recordDate | date |
1515
| temperature | int |
1616
+---------------+---------+
17-
In SQL, id is the primary key for this table.
17+
id is the column with unique values for this table.
1818
This table contains information about the temperature on a certain day.
1919
</pre>
2020

2121
<p>&nbsp;</p>
2222

23-
<p>Find all dates&#39; <code>Id</code> with higher temperatures compared to its previous dates (yesterday).</p>
23+
<p>Write a solution to find all dates&#39; <code>Id</code> with higher temperatures compared to its previous dates (yesterday).</p>
2424

2525
<p>Return the result table in <strong>any order</strong>.</p>
2626

solution/0200-0299/0209.Minimum Size Subarray Sum/README.md

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

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

9-
<p>给定一个含有 <code>n</code><strong> </strong>个正整数的数组和一个正整数 <code>target</code><strong> 。</strong></p>
9+
<p>给定一个含有&nbsp;<code>n</code><strong>&nbsp;</strong>个正整数的数组和一个正整数 <code>target</code><strong> 。</strong></p>
1010

11-
<p>找出该数组中满足其和<strong> </strong><code>target</code><strong> </strong>的长度最小的 <strong>连续子数组</strong> <code>[nums<sub>l</sub>, nums<sub>l+1</sub>, ..., nums<sub>r-1</sub>, nums<sub>r</sub>]</code> ,并返回其长度<strong>。</strong>如果不存在符合条件的子数组,返回 <code>0</code> 。</p>
11+
<p>找出该数组中满足其总和大于等于<strong> </strong><code>target</code><strong> </strong>的长度最小的 <strong>连续子数组</strong>&nbsp;<code>[nums<sub>l</sub>, nums<sub>l+1</sub>, ..., nums<sub>r-1</sub>, nums<sub>r</sub>]</code> ,并返回其长度<strong>。</strong>如果不存在符合条件的子数组,返回 <code>0</code> 。</p>
1212

13-
<p> </p>
13+
<p>&nbsp;</p>
1414

1515
<p><strong>示例 1:</strong></p>
1616

1717
<pre>
1818
<strong>输入:</strong>target = 7, nums = [2,3,1,2,4,3]
1919
<strong>输出:</strong>2
20-
<strong>解释:</strong>子数组 <code>[4,3]</code> 是该条件下的长度最小的子数组。
20+
<strong>解释:</strong>子数组&nbsp;<code>[4,3]</code>&nbsp;是该条件下的长度最小的子数组。
2121
</pre>
2222

2323
<p><strong>示例 2:</strong></p>
@@ -34,17 +34,17 @@
3434
<strong>输出:</strong>0
3535
</pre>
3636

37-
<p> </p>
37+
<p>&nbsp;</p>
3838

3939
<p><strong>提示:</strong></p>
4040

4141
<ul>
42-
<li><code>1 <= target <= 10<sup>9</sup></code></li>
43-
<li><code>1 <= nums.length <= 10<sup>5</sup></code></li>
44-
<li><code>1 <= nums[i] <= 10<sup>5</sup></code></li>
42+
<li><code>1 &lt;= target &lt;= 10<sup>9</sup></code></li>
43+
<li><code>1 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
44+
<li><code>1 &lt;= nums[i] &lt;= 10<sup>5</sup></code></li>
4545
</ul>
4646

47-
<p> </p>
47+
<p>&nbsp;</p>
4848

4949
<p><strong>进阶:</strong></p>
5050

solution/0400-0499/0403.Frog Jump/README_EN.md

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

77
<p>A frog is crossing a river. The river is divided into some number of units, and at each unit, there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.</p>
88

9-
<p>Given a list of <code>stones</code>&#39; positions (in units) in sorted <strong>ascending order</strong>, determine if the frog can cross the river by landing on the last stone. Initially, the frog is on the first stone and assumes the first jump must be <code>1</code> unit.</p>
9+
<p>Given a list of <code>stones</code>&nbsp;positions (in units) in sorted <strong>ascending order</strong>, determine if the frog can cross the river by landing on the last stone. Initially, the frog is on the first stone and assumes the first jump must be <code>1</code> unit.</p>
1010

1111
<p>If the frog&#39;s last jump was <code>k</code> units, its next jump must be either <code>k - 1</code>, <code>k</code>, or <code>k + 1</code> units. The frog can only jump in the forward direction.</p>
1212

solution/0500-0599/0560.Subarray Sum Equals K/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
<p>给你一个整数数组 <code>nums</code> 和一个整数&nbsp;<code>k</code> ,请你统计并返回 <em>该数组中和为&nbsp;<code>k</code><strong>&nbsp;</strong>的连续子数组的个数&nbsp;</em>。</p>
1010

11+
<p>子数组是数组中元素的连续非空序列。</p>
12+
1113
<p>&nbsp;</p>
1214

1315
<p><strong>示例 1:</strong></p>

solution/0500-0599/0577.Employee Bonus/README.md

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,75 @@
66

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

9-
<p>选出所有 bonus &lt; 1000 的员工的 name 及其 bonus。</p>
10-
11-
<p><code>Employee</code> 表单</p>
12-
13-
<pre>+-------+--------+-----------+--------+
14-
| empId | name | supervisor| salary |
15-
+-------+--------+-----------+--------+
16-
| 1 | John | 3 | 1000 |
17-
| 2 | Dan | 3 | 2000 |
18-
| 3 | Brad | null | 4000 |
19-
| 4 | Thomas | 3 | 4000 |
20-
+-------+--------+-----------+--------+
21-
empId 是这张表单的主关键字
9+
<p>表:<code>Employee</code>&nbsp;</p>
10+
11+
<pre>
12+
+-------------+---------+
13+
| Column Name | Type |
14+
+-------------+---------+
15+
| empId | int |
16+
| name | varchar |
17+
| supervisor | int |
18+
| salary | int |
19+
+-------------+---------+
20+
empId 是该表中具有唯一值的列。
21+
该表的每一行都表示员工的姓名和 id,以及他们的工资和经理的 id。
2222
</pre>
2323

24-
<p><code>Bonus</code> 表单</p>
24+
<p>&nbsp;</p>
2525

26-
<pre>+-------+-------+
27-
| empId | bonus |
28-
+-------+-------+
29-
| 2 | 500 |
30-
| 4 | 2000 |
31-
+-------+-------+
32-
empId 是这张表单的主关键字
26+
<p>表:<code>Bonus</code></p>
27+
28+
<pre>
29+
+-------------+------+
30+
| Column Name | Type |
31+
+-------------+------+
32+
| empId | int |
33+
| bonus | int |
34+
+-------------+------+
35+
empId 是该表具有唯一值的列。
36+
empId 是 Employee 表中 empId 的外键(reference 列)。
37+
该表的每一行都包含一个员工的 id 和他们各自的奖金。
3338
</pre>
3439

35-
<p>输出示例:</p>
40+
<p>&nbsp;</p>
41+
42+
<p>编写解决方案,报告每个奖金 <strong>少于</strong> <code>1000</code> 的员工的姓名和奖金数额。</p>
43+
44+
<p>以 <strong>任意顺序</strong> 返回结果表。</p>
3645

37-
<pre>+-------+-------+
38-
| name | bonus |
46+
<p>结果格式如下所示。</p>
47+
48+
<p>&nbsp;</p>
49+
50+
<p><strong>示例 1:</strong></p>
51+
52+
<pre>
53+
<b>输入:</b>
54+
Employee table:
55+
+-------+--------+------------+--------+
56+
| empId | name | supervisor | salary |
57+
+-------+--------+------------+--------+
58+
| 3 | Brad | null | 4000 |
59+
| 1 | John | 3 | 1000 |
60+
| 2 | Dan | 3 | 2000 |
61+
| 4 | Thomas | 3 | 4000 |
62+
+-------+--------+------------+--------+
63+
Bonus table:
64+
+-------+-------+
65+
| empId | bonus |
3966
+-------+-------+
40-
| John | null |
41-
| Dan | 500 |
42-
| Brad | null |
67+
| 2 | 500 |
68+
| 4 | 2000 |
4369
+-------+-------+
44-
</pre>
70+
<b>输出:</b>
71+
+------+-------+
72+
| name | bonus |
73+
+------+-------+
74+
| Brad | null |
75+
| John | null |
76+
| Dan | 500 |
77+
+------+-------+</pre>
4578

4679
## 解法
4780

solution/0500-0599/0577.Employee Bonus/README_EN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| supervisor | int |
1616
| salary | int |
1717
+-------------+---------+
18-
empId is the primary key column for this table.
18+
empId is the column with unique values for this table.
1919
Each row of this table indicates the name and the ID of an employee in addition to their salary and the id of their manager.
2020
</pre>
2121

@@ -30,18 +30,18 @@ Each row of this table indicates the name and the ID of an employee in addition
3030
| empId | int |
3131
| bonus | int |
3232
+-------------+------+
33-
empId is the primary key column for this table.
34-
empId is a foreign key to empId from the Employee table.
33+
empId is the column of unique values for this table.
34+
empId is a foreign key (reference column) to empId from the Employee table.
3535
Each row of this table contains the id of an employee and their respective bonus.
3636
</pre>
3737

3838
<p>&nbsp;</p>
3939

40-
<p>Write an SQL query to report the name and bonus amount of each employee with a bonus <strong>less than</strong> <code>1000</code>.</p>
40+
<p>Write a solution to report the name and bonus amount of each employee with a bonus <strong>less than</strong> <code>1000</code>.</p>
4141

4242
<p>Return the result table in <strong>any order</strong>.</p>
4343

44-
<p>The query result format is in the following example.</p>
44+
<p>The&nbsp;result format is in the following example.</p>
4545

4646
<p>&nbsp;</p>
4747
<p><strong class="example">Example 1:</strong></p>

solution/0800-0899/0813.Largest Sum of Averages/README.md

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

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

9-
<p>给定数组&nbsp;<code>nums</code>&nbsp;和一个整数&nbsp;<code>k</code>&nbsp;。我们将给定的数组&nbsp;<code>nums</code>&nbsp;分成 <strong>最多</strong>&nbsp;<code>k</code>&nbsp;个相邻的非空子数组 &nbsp;<strong>分数</strong> 由每个子数组内的平均值的总和构成。</p>
9+
<p>给定数组&nbsp;<code>nums</code>&nbsp;和一个整数&nbsp;<code>k</code>&nbsp;。我们将给定的数组&nbsp;<code>nums</code>&nbsp;分成 <strong>最多</strong>&nbsp;<code>k</code>&nbsp;个非空子数组,且数组内部是连续的&nbsp;&nbsp;<strong>分数</strong> 由每个子数组内的平均值的总和构成。</p>
1010

1111
<p>注意我们必须使用 <code>nums</code> 数组中的每一个数进行分组,并且分数不一定需要是整数。</p>
1212

0 commit comments

Comments
 (0)