Skip to content

Commit 7315928

Browse files
authored
chore: update lc problems (doocs#1563)
1 parent 255c50f commit 7315928

File tree

25 files changed

+106
-98
lines changed

25 files changed

+106
-98
lines changed

solution/0000-0099/0080.Remove Duplicates from Sorted Array II/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ for (int i = 0; i < len; i++) {
3838
<pre>
3939
<strong>输入:</strong>nums = [1,1,1,2,2,3]
4040
<strong>输出:</strong>5, nums = [1,1,2,2,3]
41-
<strong>解释:</strong>函数应返回新长度 length = <strong><code>5</code></strong>, 并且原数组的前五个元素被修改为 <strong><code>1, 1, 2, 2,</code></strong> <strong>3 </strong>。 不需要考虑数组中超出新长度后面的元素。
41+
<strong>解释:</strong>函数应返回新长度 length = <strong><code>5</code></strong>, 并且原数组的前五个元素被修改为 <strong><code>1, 1, 2, 2, 3</code></strong>。 不需要考虑数组中超出新长度后面的元素。
4242
</pre>
4343

4444
<p><strong>示例 2:</strong></p>
4545

4646
<pre>
4747
<strong>输入:</strong>nums = [0,0,1,1,1,1,2,3,3]
4848
<strong>输出:</strong>7, nums = [0,0,1,1,2,3,3]
49-
<strong>解释:</strong>函数应返回新长度 length = <strong><code>7</code></strong>, 并且原数组的前五个元素被修改为&nbsp;<strong><code>0</code></strong>, <strong>0</strong>, <strong>1</strong>, <strong>1</strong>, <strong>2</strong>, <strong>3</strong>, <strong>3 。</strong> 不需要考虑数组中超出新长度后面的元素。
49+
<strong>解释:</strong>函数应返回新长度 length = <strong><code>7</code></strong>, 并且原数组的前五个元素被修改为&nbsp;<strong><code>0, 0, 1, 1, 2, 3, 3</code></strong>不需要考虑数组中超出新长度后面的元素。
5050
</pre>
5151

5252
<p>&nbsp;</p>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<li><code>1 &lt;= nums1.length, nums2.length &lt;= 10<sup>5</sup></code></li>
4949
<li><code>-10<sup>9</sup> &lt;= nums1[i], nums2[i] &lt;= 10<sup>9</sup></code></li>
5050
<li><code>nums1</code> 和 <code>nums2</code> 均为升序排列</li>
51-
<li><code>1 &lt;= k &lt;= 1000</code></li>
51+
<li><code>1 &lt;= k &lt;= 10<sup>4</sup></code></li>
5252
</ul>
5353

5454
## 解法

solution/1100-1199/1174.Immediate Food Delivery II/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| order_date | date |
1616
| customer_pref_delivery_date | date |
1717
+-----------------------------+---------+
18-
delivery_id is the primary key of this table.
18+
delivery_id is the column of unique values of this table.
1919
The table holds information about food delivery to customers that make orders at some date and specify a preferred delivery date (on the same order date or after it).
2020
</pre>
2121

@@ -25,9 +25,9 @@ The table holds information about food delivery to customers that make orders at
2525

2626
<p>The <strong>first order</strong> of a customer is the order with the earliest order date that the customer made. It is guaranteed that a customer has precisely one first order.</p>
2727

28-
<p>Write an SQL query to find the percentage of immediate orders in the first orders of all customers, <strong>rounded to 2 decimal places</strong>.</p>
28+
<p>Write a solution to find the percentage of immediate orders in the first orders of all customers, <strong>rounded to 2 decimal places</strong>.</p>
2929

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

3232
<p>&nbsp;</p>
3333
<p><strong class="example">Example 1:</strong></p>

solution/1200-1299/1204.Last Person to Fit in the Bus/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| weight | int |
1616
| turn | int |
1717
+-------------+---------+
18-
person_id is the primary key column for this table.
18+
person_id column contains unique values.
1919
This table has the information about all people waiting for a bus.
2020
The person_id and turn columns will contain all numbers from 1 to n, where n is the number of rows in the table.
2121
turn determines the order of which the people will board the bus, where turn=1 denotes the first person to board and turn=n denotes the last person to board.
@@ -26,9 +26,9 @@ weight is the weight of the person in kilograms.
2626

2727
<p>There is a queue of people waiting to board a bus. However, the bus has a weight limit of <code>1000</code><strong> kilograms</strong>, so there may be some people who cannot board.</p>
2828

29-
<p>Write an SQL query to find the <code>person_name</code> of the <strong>last person</strong> that can fit on the bus without exceeding the weight limit. The test cases are generated such that the first person does not exceed the weight limit.</p>
29+
<p>Write a solution to find the <code>person_name</code> of the <strong>last person</strong> that can fit on the bus without exceeding the weight limit. The test cases are generated such that the first person does not exceed the weight limit.</p>
3030

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

3333
<p>&nbsp;</p>
3434
<p><strong class="example">Example 1:</strong></p>

solution/1200-1299/1211.Queries Quality and Percentage/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
| position | int |
1616
| rating | int |
1717
+-------------+---------+
18-
There is no primary key for this table, it may have duplicate rows.
18+
This table may have duplicate rows.
1919
This table contains information collected from some queries on a database.
2020
The <code>position</code> column has a value from <strong>1</strong> to <strong>500</strong>.
2121
The <code>rating</code> column has a value from <strong>1</strong> to <strong>5</strong>. Query with <code>rating</code> less than 3 is a poor query.
@@ -35,13 +35,13 @@ The <code>rating</code> column has a value from <strong>1</strong> to <strong>5<
3535
<p>The percentage of all queries with rating less than 3.</p>
3636
</blockquote>
3737

38-
<p>Write an SQL query to find each <code>query_name</code>, the <code>quality</code> and <code>poor_query_percentage</code>.</p>
38+
<p>Write a solution to find each <code>query_name</code>, the <code>quality</code> and <code>poor_query_percentage</code>.</p>
3939

4040
<p>Both <code>quality</code> and <code>poor_query_percentage</code> should be <strong>rounded to 2 decimal places</strong>.</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/1200-1299/1212.Team Scores in Football Tournament/README_EN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
| team_id | int |
1414
| team_name | varchar |
1515
+---------------+----------+
16-
team_id is the primary key of this table.
16+
team_id is the column with unique values of this table.
1717
Each row of this table represents a single football team.
1818
</pre>
1919

@@ -31,7 +31,7 @@ Each row of this table represents a single football team.
3131
| host_goals | int |
3232
| guest_goals | int |
3333
+---------------+---------+
34-
match_id is the primary key of this table.
34+
match_id is the column of unique values of this table.
3535
Each row is a record of a finished match between two different teams.
3636
Teams host_team and guest_team are represented by their IDs in the Teams table (team_id), and they scored host_goals and guest_goals goals, respectively.
3737
</pre>
@@ -45,11 +45,11 @@ You would like to compute the scores of all teams after all matches. Points are
4545
<li>A team receives <strong>no points</strong> if they lose a match (i.e., Scored fewer goals than the opponent team).</li>
4646
</ul>
4747

48-
<p>Write an SQL query that selects the <code>team_id</code>, <code>team_name</code> and <code>num_points</code> of each team in the tournament after all described matches.</p>
48+
<p>Write a solution that selects the <code>team_id</code>, <code>team_name</code> and <code>num_points</code> of each team in the tournament after all described matches.</p>
4949

5050
<p>Return the result table ordered by <code>num_points</code> <strong>in decreasing order</strong>. In case of a tie, order the records by <code>team_id</code> <strong>in increasing order</strong>.</p>
5151

52-
<p>The query result format is in the following example.</p>
52+
<p>The result format is in the following example.</p>
5353

5454
<p>&nbsp;</p>
5555
<p><strong class="example">Example 1:</strong></p>

solution/1200-1299/1264.Page Recommendations/README_EN.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
| user1_id | int |
1414
| user2_id | int |
1515
+---------------+---------+
16-
(user1_id, user2_id) is the primary key for this table.
16+
(user1_id, user2_id) is the primary key (combination of columns with unique values) for this table.
1717
Each row of this table indicates that there is a friendship relation between user1_id and user2_id.
1818
</pre>
1919

@@ -28,17 +28,17 @@ Each row of this table indicates that there is a friendship relation between use
2828
| user_id | int |
2929
| page_id | int |
3030
+-------------+---------+
31-
(user_id, page_id) is the primary key for this table.
31+
(user_id, page_id) is the primary key (combination of columns with unique values) for this table.
3232
Each row of this table indicates that user_id likes page_id.
3333
</pre>
3434

3535
<p>&nbsp;</p>
3636

37-
<p>Write an SQL query to recommend pages to the user with <code>user_id = 1</code> using the pages that your friends liked. It should not recommend pages you already liked.</p>
37+
<p>Write a solution&nbsp;to recommend pages to the user with <code>user_id = 1</code> using the pages that your friends liked. It should not recommend pages you already liked.</p>
3838

3939
<p>Return result table in <strong>any order</strong> without duplicates.</p>
4040

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

4343
<p>&nbsp;</p>
4444
<p><strong class="example">Example 1:</strong></p>

solution/1200-1299/1270.All People Report to the Given Manager/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
| employee_name | varchar |
1515
| manager_id | int |
1616
+---------------+---------+
17-
employee_id is the primary key for this table.
17+
employee_id is the column of unique values for this table.
1818
Each row of this table indicates that the employee with ID employee_id and name employee_name reports his work to his/her direct manager with manager_id
1919
The head of the company is the employee with employee_id = 1.
2020
</pre>
2121

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

24-
<p>Write an SQL query to find <code>employee_id</code> of all employees that directly or indirectly report their work to the head of the company.</p>
24+
<p>Write a solution to find <code>employee_id</code> of all employees that directly or indirectly report their work to the head of the company.</p>
2525

2626
<p>The indirect relation between managers <strong>will not exceed three managers</strong> as the company is small.</p>
2727

2828
<p>Return the result table in <strong>any order</strong>.</p>
2929

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

3232
<p>&nbsp;</p>
3333
<p><strong class="example">Example 1:</strong></p>

solution/1200-1299/1285.Find the Start and End Number of Continuous Ranges/README_EN.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
+---------------+---------+
1313
| log_id | int |
1414
+---------------+---------+
15-
log_id is the primary key for this table.
15+
log_id is the column of unique values for this table.
1616
Each row of this table contains the ID in a log Table.
1717
</pre>
1818

1919
<p>&nbsp;</p>
2020

21-
<p>Write an SQL query to find the start and end number of continuous ranges in the table <code>Logs</code>.</p>
21+
<p>Write a solution to find the start and end number of continuous ranges in the table <code>Logs</code>.</p>
2222

2323
<p>Return the result table ordered by <code>start_id</code>.</p>
2424

25-
<p>The query result format is in the following example.</p>
25+
<p>The result format is in the following example.</p>
2626

2727
<p>&nbsp;</p>
2828
<p><strong class="example">Example 1:</strong></p>

solution/1300-1399/1326.Minimum Number of Taps to Open to Water a Garden/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>There is a one-dimensional garden on the x-axis. The garden starts at the point <code>0</code> and ends at the point <code>n</code>. (i.e The length of the garden is <code>n</code>).</p>
7+
<p>There is a one-dimensional garden on the x-axis. The garden starts at the point <code>0</code> and ends at the point <code>n</code>. (i.e., the&nbsp;length of the garden is <code>n</code>).</p>
88

99
<p>There are <code>n + 1</code> taps located at points <code>[0, 1, ..., n]</code> in the garden.</p>
1010

0 commit comments

Comments
 (0)