Skip to content

Commit c4674c0

Browse files
authored
chore: update lc problems (#1777)
* chore: update lc problems * docs: update summary
1 parent 5130a71 commit c4674c0

File tree

14 files changed

+82
-88
lines changed

14 files changed

+82
-88
lines changed

.github/workflows/pretter-lint.yml

-22
This file was deleted.

solution/2800-2899/2877.Create a DataFrame from List/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

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

9-
<p>编写一个解决方案,从名为 &nbsp;<code>student_data</code>&nbsp;的二维列表&nbsp;<b>创建 </b>一个 DataFrame 。这个二维列表包含一些学生的 ID 和年龄信息。</p>
9+
<p>编写一个解决方案,基于名为&nbsp;&nbsp;<code>student_data</code>&nbsp;的二维列表&nbsp;<b>创建 </b>一个 DataFrame 。这个二维列表包含一些学生的 ID 和年龄信息。</p>
1010

1111
<p>DataFrame 应该有两列,&nbsp;<code>student_id</code>&nbsp;&nbsp;<code>age</code>,并且与原始二维列表的顺序相同。</p>
1212

@@ -35,7 +35,7 @@
3535
| 4 | 20 |
3636
+------------+-----+
3737
<b>解释:</b>
38-
student_data 上创建了一个 DataFrame,包含 student_id 和 age 两列。
38+
基于 student_data 创建了一个 DataFrame,包含 student_id 和 age 两列。
3939
</pre>
4040

4141
## 解法

solution/2800-2899/2878.Get the Size of a DataFrame/README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [2878. Get the Size of a DataFrame](https://leetcode.cn/problems/get-the-size-of-a-dataframe)
1+
# [2878. 获取 DataFrame 的大小](https://leetcode.cn/problems/get-the-size-of-a-dataframe)
22

33
[English Version](/solution/2800-2899/2878.Get%20the%20Size%20of%20a%20DataFrame/README_EN.md)
44

@@ -19,19 +19,20 @@ DataFrame <code>players:</code>
1919
+-------------+--------+
2020
</pre>
2121

22-
<p>Write a solution to calculate and display the <strong>number of rows and columns</strong> of <code>players</code>.</p>
22+
<p>编写一个解决方案,计算并显示&nbsp;<code>players</code>&nbsp;&nbsp;<strong>行数和列数</strong>。</p>
2323

24-
<p>Return the result as an array:</p>
24+
<p>将结果返回为一个数组:</p>
2525

2626
<p><code>[number of rows, number of columns]</code></p>
2727

28-
<p>The result format is in the following example.</p>
28+
<p>返回结果格式如下示例所示。</p>
2929

3030
<p>&nbsp;</p>
31-
<p><strong class="example">Example 1:</strong></p>
31+
32+
<p><b>示例 1:</b></p>
3233

3334
<pre>
34-
<strong>Input:
35+
<strong>输入:
3536
</strong>+-----------+----------+-----+-------------+--------------------+
3637
| player_id | name | age | position | team |
3738
+-----------+----------+-----+-------------+--------------------+
@@ -46,10 +47,10 @@ DataFrame <code>players:</code>
4647
| 761 | Jack | 33 | Midfielder | ManchesterCity |
4748
| 642 | Charlie | 36 | Center-back | Arsenal |
4849
+-----------+----------+-----+-------------+--------------------+<strong>
49-
Output:
50+
输出:
5051
</strong>[10, 5]
51-
<strong>Explanation:</strong>
52-
This DataFrame contains 10 rows and 5 columns.
52+
<b>解释:</b>
53+
这个 DataFrame 包含 10 行和 5 列。
5354
</pre>
5455

5556
## 解法

solution/2800-2899/2879.Display the First Three Rows/README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [2879. Display the First Three Rows](https://leetcode.cn/problems/display-the-first-three-rows)
1+
# [2879. 显示前三行](https://leetcode.cn/problems/display-the-first-three-rows)
22

33
[English Version](/solution/2800-2899/2879.Display%20the%20First%20Three%20Rows/README_EN.md)
44

@@ -18,13 +18,14 @@ DataFrame: <code>employees</code>
1818
+-------------+--------+
1919
</pre>
2020

21-
<p>Write a solution to display the <strong>first <code>3</code> </strong>rows<strong> </strong>of this DataFrame.</p>
21+
<p>编写一个解决方案,显示这个 DataFrame 的<strong>&nbsp;&nbsp;<code>3</code>&nbsp;</strong>行。</p>
2222

2323
<p>&nbsp;</p>
24-
<p><strong class="example">Example 1:</strong></p>
24+
25+
<p><b>示例 1:</b></p>
2526

2627
<pre>
27-
<strong>Input:
28+
<strong>输入:
2829
</strong>DataFrame employees
2930
+-------------+-----------+-----------------------+--------+
3031
| employee_id | name | department | salary |
@@ -36,16 +37,16 @@ DataFrame: <code>employees</code>
3637
| 49 | Jonathan | HumanResources | 23793 |
3738
| 43 | Khaled | Administration | 40454 |
3839
+-------------+-----------+-----------------------+--------+
39-
<strong>Output:</strong>
40+
<b>输出:</b>
4041
+-------------+---------+-------------+--------+
4142
| employee_id | name | department | salary |
4243
+-------------+---------+-------------+--------+
4344
| 3 | Bob | Operations | 48675 |
4445
| 90 | Alice | Sales | 11096 |
4546
| 9 | Tatiana | Engineering | 33805 |
4647
+-------------+---------+-------------+--------+
47-
<strong>Explanation:</strong>
48-
Only the first 3 rows are displayed.</pre>
48+
<b>解释:</b>
49+
只有前 3 行被显示。</pre>
4950

5051
## 解法
5152

solution/2800-2899/2880.Select Data/README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [2880. Select Data](https://leetcode.cn/problems/select-data)
1+
# [2880. 数据选取](https://leetcode.cn/problems/select-data)
22

33
[English Version](/solution/2800-2899/2880.Select%20Data/README_EN.md)
44

@@ -18,14 +18,16 @@ DataFrame students
1818

1919
</pre>
2020

21-
<p>Write a solution to select the name and age of the student with <code>student_id = 101</code>.</p>
21+
<p>编写一个解决方案,选择&nbsp;<code>student_id = 101</code>&nbsp;的学生的 name 和 age 并输出。</p>
2222

23-
<p>The result format is in the following example.</p>
23+
<p>返回结果格式如下示例所示。</p>
2424

2525
<p>&nbsp;</p>
26+
27+
<p><strong>示例 1:</strong></p>
28+
2629
<pre>
27-
<strong>Example 1:
28-
Input:</strong>
30+
<b>输入:</b>
2931
+------------+---------+-----+
3032
| student_id | name | age |
3133
+------------+---------+-----+
@@ -34,14 +36,14 @@ Input:</strong>
3436
| 128 | Henry | 6 |
3537
| 3 | Henry | 11 |
3638
+------------+---------+-----+
37-
<strong>Output:</strong>
39+
<b>输出:</b>
3840
+---------+-----+
3941
| name | age |
4042
+---------+-----+
4143
| Ulysses | 13 |
4244
+---------+-----+
43-
<strong>Explanation:
44-
</strong>Student Ulysses has student_id = 101, we select the name and age.</pre>
45+
<strong>解释:
46+
</strong>学生 Ulysses student_id = 101,所以我们输出了他的 name age</pre>
4547

4648
## 解法
4749

solution/2800-2899/2881.Create a New Column/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ DataFrame employees
5151
| Thomas | 24433 | 48866 |
5252
+---------+--------+--------+
5353
<b>解释:</b>
54-
通过将salary列中的值加倍创建了一个新的bonus列。</pre>
54+
通过将 salary 列中的值加倍创建了一个新的 bonus 列。</pre>
5555

5656
## 解法
5757

solution/2800-2899/2889.Reshape Data Pivot/README.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [2889. Reshape Data Pivot](https://leetcode.cn/problems/reshape-data-pivot)
1+
# [2889. 数据重塑:透视](https://leetcode.cn/problems/reshape-data-pivot)
22

33
[English Version](/solution/2800-2899/2889.Reshape%20Data%20Pivot/README_EN.md)
44

@@ -17,14 +17,15 @@ DataFrame <code>weather</code>
1717
+-------------+--------+
1818
</pre>
1919

20-
<p>Write a solution to <strong>pivot</strong> the data so that each row represents temperatures for a specific month, and each city is a separate column.</p>
20+
<p>编写一个解决方案,以便将数据&nbsp;<strong>旋转</strong>,使得每一行代表特定月份的温度,而每个城市都是一个单独的列。</p>
2121

22-
<p>The result format is in the following example.</p>
22+
<p>输出结果格式如下示例所示。</p>
2323

2424
<p>&nbsp;</p>
25+
<b>示例 1:</b>
26+
2527
<pre>
26-
<strong class="example">Example 1:</strong>
27-
<strong>Input:</strong>
28+
<b>输入:</b>
2829
+--------------+----------+-------------+
2930
| city | month | temperature |
3031
+--------------+----------+-------------+
@@ -39,7 +40,7 @@ DataFrame <code>weather</code>
3940
| ElPaso | April | 2 |
4041
| ElPaso | May | 43 |
4142
+--------------+----------+-------------+
42-
<strong>Output:</strong><code>
43+
<code><b>输出:</b>
4344
+----------+--------+--------------+
4445
| month | ElPaso | Jacksonville |
4546
+----------+--------+--------------+
@@ -49,8 +50,8 @@ DataFrame <code>weather</code>
4950
| March | 26 | 38 |
5051
| May | 43 | 34 |
5152
+----------+--------+--------------+</code>
52-
<strong>Explanation:
53-
</strong>The table is pivoted, each column represents a city, and each row represents a specific month.</pre>
53+
<strong>解释:
54+
</strong>表格被旋转,每一列代表一个城市,每一行代表特定的月份。</pre>
5455

5556
## 解法
5657

solution/2800-2899/2891.Method Chaining/README.md

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [2891. Method Chaining](https://leetcode.cn/problems/method-chaining)
1+
# [2891. 方法链](https://leetcode.cn/problems/method-chaining)
22

33
[English Version](/solution/2800-2899/2891.Method%20Chaining/README_EN.md)
44

@@ -18,17 +18,18 @@ DataFrame <code>animals</code>
1818
+-------------+--------+
1919
</pre>
2020

21-
<p>Write a solution to list the names of animals that weigh <strong>strictly more than</strong> <code>100</code> kilograms.</p>
21+
<p>编写一个解决方案来列出体重 <strong>严格超过&nbsp;</strong>&nbsp;<code>100</code>&nbsp; 千克的动物的名称。</p>
2222

23-
<p>Return the&nbsp;animals sorted by weight in <strong>descending order</strong>.</p>
23+
<p>按体重 <strong>降序</strong> 返回动物。</p>
2424

25-
<p>The result format is in the following example.</p>
25+
<p>返回结果格式如下示例所示。</p>
2626

2727
<p>&nbsp;</p>
28-
<p><strong>Example 1:</strong></p>
28+
29+
<p><b>示例 1:</b></p>
2930

3031
<pre>
31-
<strong>Input:</strong>
32+
<b>输入:</b>
3233
DataFrame animals:
3334
+----------+---------+-----+--------+
3435
| name | species | age | weight |
@@ -40,7 +41,7 @@ DataFrame animals:
4041
| Stefan | Bear | 100 | 50 |
4142
| Tommy | Panda | 26 | 349 |
4243
+----------+---------+-----+--------+
43-
<strong>Output:</strong>
44+
<b>输出:</b>
4445
+----------+
4546
| name |
4647
+----------+
@@ -49,15 +50,16 @@ DataFrame animals:
4950
| Tommy |
5051
| Alex |
5152
+----------+
52-
<strong>Explanation:</strong>
53-
All animals weighing more than 100 should be included in the results table.
54-
Tatiana&#39;s weight is 464, Jonathan&#39;s weight is 463, Tommy&#39;s weight is 349, and Alex&#39;s weight is 328.
55-
The results should be sorted in descending order of weight.</pre>
53+
<b>解释:</b>
54+
所有体重超过 100 的动物都应包含在结果表中。
55+
Tatiana 的体重为 464Jonathan 的体重为 463Tommy 的体重为 349Alex 的体重为 328
56+
结果应按体重降序排序。</pre>
5657

5758
<p>&nbsp;</p>
58-
<p>In Pandas, <strong>method chaining</strong> enables us to&nbsp;perform operations on a DataFrame without breaking up each operation into a separate line or creating multiple temporary variables.&nbsp;</p>
5959

60-
<p>Can you complete this&nbsp;task in just <strong>one line </strong>of code using method chaining?</p>
60+
<p>在 Pandas 中,<strong>方法链</strong> 允许我们在 DataFrame 上执行操作,而无需将每个操作拆分成单独的行或创建多个临时变量。</p>
61+
62+
<p>你能用 <strong>一行</strong> 代码的方法链完成这个任务吗?</p>
6163

6264
## 解法
6365

solution/JAVASCRIPT_README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
| 2629 | [复合函数](/solution/2600-2699/2629.Function%20Composition/README.md) | | 简单 | |
2525
| 2630 | [记忆函数 II](/solution/2600-2699/2630.Memoize%20II/README.md) | | 困难 | |
2626
| 2631 | [分组](/solution/2600-2699/2631.Group%20By/README.md) | | 中等 | |
27-
| 2632 | [柯里化](/solution/2600-2699/2632.Curry/README.md) | | 中等 | 🔒 |
27+
| 2632 | [柯里化](/solution/2600-2699/2632.Curry/README.md) | | 困难 | 🔒 |
2828
| 2633 | [将对象转换为 JSON 字符串](/solution/2600-2699/2633.Convert%20Object%20to%20JSON%20String/README.md) | | 中等 | 🔒 |
2929
| 2634 | [过滤数组中的元素](/solution/2600-2699/2634.Filter%20Elements%20from%20Array/README.md) | | 简单 | |
3030
| 2635 | [转换数组中的每个元素](/solution/2600-2699/2635.Apply%20Transform%20Over%20Each%20Element%20in%20Array/README.md) | | 简单 | |
@@ -34,9 +34,9 @@
3434
| 2649 | [嵌套数组生成器](/solution/2600-2699/2649.Nested%20Array%20Generator/README.md) | | 中等 | |
3535
| 2650 | [设计可取消函数](/solution/2600-2699/2650.Design%20Cancellable%20Function/README.md) | | 困难 | |
3636
| 2665 | [计数器 II](/solution/2600-2699/2665.Counter%20II/README.md) | | 简单 | |
37-
| 2666 | [只允许一次函数调用](/solution/2600-2699/2666.Allow%20One%20Function%20Call/README.md) | | 简单 | |
37+
| 2666 | [只允许一次函数调用 44](/solution/2600-2699/2666.Allow%20One%20Function%20Call/README.md) | | 简单 | |
3838
| 2667 | [创建 Hello World 函数](/solution/2600-2699/2667.Create%20Hello%20World%20Function/README.md) | | 简单 | |
39-
| 2675 | [将对象数组转换为矩阵](/solution/2600-2699/2675.Array%20of%20Objects%20to%20Matrix/README.md) | | 中等 | 🔒 |
39+
| 2675 | [将对象数组转换为矩阵](/solution/2600-2699/2675.Array%20of%20Objects%20to%20Matrix/README.md) | | 困难 | 🔒 |
4040
| 2676 | [节流](/solution/2600-2699/2676.Throttle/README.md) | | 中等 | 🔒 |
4141
| 2677 | [分块数组](/solution/2600-2699/2677.Chunk%20Array/README.md) | | 简单 | |
4242
| 2690 | [无穷方法对象](/solution/2600-2699/2690.Infinite%20Method%20Object/README.md) | | 简单 | 🔒 |
@@ -52,7 +52,7 @@
5252
| 2715 | [执行可取消的延迟函数](/solution/2700-2799/2715.Timeout%20Cancellation/README.md) | | 简单 | |
5353
| 2721 | [并行执行异步函数](/solution/2700-2799/2721.Execute%20Asynchronous%20Functions%20in%20Parallel/README.md) | | 中等 | |
5454
| 2722 | [根据 ID 合并两个数组](/solution/2700-2799/2722.Join%20Two%20Arrays%20by%20ID/README.md) | | 中等 | |
55-
| 2723 | [添加两个 Promise 对象](/solution/2700-2799/2723.Add%20Two%20Promises/README.md) | | 简单 | |
55+
| 2723 | [两个 Promise 对象相加](/solution/2700-2799/2723.Add%20Two%20Promises/README.md) | | 简单 | |
5656
| 2724 | [排序方式](/solution/2700-2799/2724.Sort%20By/README.md) | | 简单 | |
5757
| 2725 | [间隔取消](/solution/2700-2799/2725.Interval%20Cancellation/README.md) | | 简单 | |
5858
| 2726 | [使用方法链的计算器](/solution/2700-2799/2726.Calculator%20with%20Method%20Chaining/README.md) | | 简单 | |

solution/JAVASCRIPT_README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
2222
| 2629 | [Function Composition](/solution/2600-2699/2629.Function%20Composition/README_EN.md) | | Easy | |
2323
| 2630 | [Memoize II](/solution/2600-2699/2630.Memoize%20II/README_EN.md) | | Hard | |
2424
| 2631 | [Group By](/solution/2600-2699/2631.Group%20By/README_EN.md) | | Medium | |
25-
| 2632 | [Curry](/solution/2600-2699/2632.Curry/README_EN.md) | | Medium | 🔒 |
25+
| 2632 | [Curry](/solution/2600-2699/2632.Curry/README_EN.md) | | Hard | 🔒 |
2626
| 2633 | [Convert Object to JSON String](/solution/2600-2699/2633.Convert%20Object%20to%20JSON%20String/README_EN.md) | | Medium | 🔒 |
2727
| 2634 | [Filter Elements from Array](/solution/2600-2699/2634.Filter%20Elements%20from%20Array/README_EN.md) | | Easy | |
2828
| 2635 | [Apply Transform Over Each Element in Array](/solution/2600-2699/2635.Apply%20Transform%20Over%20Each%20Element%20in%20Array/README_EN.md) | | Easy | |
@@ -34,7 +34,7 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
3434
| 2665 | [Counter II](/solution/2600-2699/2665.Counter%20II/README_EN.md) | | Easy | |
3535
| 2666 | [Allow One Function Call](/solution/2600-2699/2666.Allow%20One%20Function%20Call/README_EN.md) | | Easy | |
3636
| 2667 | [Create Hello World Function](/solution/2600-2699/2667.Create%20Hello%20World%20Function/README_EN.md) | | Easy | |
37-
| 2675 | [Array of Objects to Matrix](/solution/2600-2699/2675.Array%20of%20Objects%20to%20Matrix/README_EN.md) | | Medium | 🔒 |
37+
| 2675 | [Array of Objects to Matrix](/solution/2600-2699/2675.Array%20of%20Objects%20to%20Matrix/README_EN.md) | | Hard | 🔒 |
3838
| 2676 | [Throttle](/solution/2600-2699/2676.Throttle/README_EN.md) | | Medium | 🔒 |
3939
| 2677 | [Chunk Array](/solution/2600-2699/2677.Chunk%20Array/README_EN.md) | | Easy | |
4040
| 2690 | [Infinite Method Object](/solution/2600-2699/2690.Infinite%20Method%20Object/README_EN.md) | | Easy | 🔒 |

0 commit comments

Comments
 (0)