Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update lc problems #1777

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .github/workflows/pretter-lint.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

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

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

Expand Down Expand Up @@ -35,7 +35,7 @@
| 4 | 20 |
+------------+-----+
<b>解释:</b>
student_data 上创建了一个 DataFrame,包含 student_id 和 age 两列。
基于 student_data 创建了一个 DataFrame,包含 student_id 和 age 两列。
</pre>

## 解法
Expand Down
19 changes: 10 additions & 9 deletions solution/2800-2899/2878.Get the Size of a DataFrame/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [2878. Get the Size of a DataFrame](https://leetcode.cn/problems/get-the-size-of-a-dataframe)
# [2878. 获取 DataFrame 的大小](https://leetcode.cn/problems/get-the-size-of-a-dataframe)

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

Expand All @@ -19,19 +19,20 @@ DataFrame <code>players:</code>
+-------------+--------+
</pre>

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

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

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

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

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

<p><b>示例 1:</b></p>

<pre>
<strong>Input:
<strong>输入:
</strong>+-----------+----------+-----+-------------+--------------------+
| player_id | name | age | position | team |
+-----------+----------+-----+-------------+--------------------+
Expand All @@ -46,10 +47,10 @@ DataFrame <code>players:</code>
| 761 | Jack | 33 | Midfielder | ManchesterCity |
| 642 | Charlie | 36 | Center-back | Arsenal |
+-----------+----------+-----+-------------+--------------------+<strong>
Output:
输出:
</strong>[10, 5]
<strong>Explanation:</strong>
This DataFrame contains 10 rows and 5 columns.
<b>解释:</b>
这个 DataFrame 包含 10 行和 5 列。
</pre>

## 解法
Expand Down
15 changes: 8 additions & 7 deletions solution/2800-2899/2879.Display the First Three Rows/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [2879. Display the First Three Rows](https://leetcode.cn/problems/display-the-first-three-rows)
# [2879. 显示前三行](https://leetcode.cn/problems/display-the-first-three-rows)

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

Expand All @@ -18,13 +18,14 @@ DataFrame: <code>employees</code>
+-------------+--------+
</pre>

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

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

<p><b>示例 1:</b></p>

<pre>
<strong>Input:
<strong>输入:
</strong>DataFrame employees
+-------------+-----------+-----------------------+--------+
| employee_id | name | department | salary |
Expand All @@ -36,16 +37,16 @@ DataFrame: <code>employees</code>
| 49 | Jonathan | HumanResources | 23793 |
| 43 | Khaled | Administration | 40454 |
+-------------+-----------+-----------------------+--------+
<strong>Output:</strong>
<b>输出:</b>
+-------------+---------+-------------+--------+
| employee_id | name | department | salary |
+-------------+---------+-------------+--------+
| 3 | Bob | Operations | 48675 |
| 90 | Alice | Sales | 11096 |
| 9 | Tatiana | Engineering | 33805 |
+-------------+---------+-------------+--------+
<strong>Explanation:</strong>
Only the first 3 rows are displayed.</pre>
<b>解释:</b>
只有前 3 行被显示。</pre>

## 解法

Expand Down
18 changes: 10 additions & 8 deletions solution/2800-2899/2880.Select Data/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [2880. Select Data](https://leetcode.cn/problems/select-data)
# [2880. 数据选取](https://leetcode.cn/problems/select-data)

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

Expand All @@ -18,14 +18,16 @@ DataFrame students

</pre>

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

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

<p>&nbsp;</p>

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

<pre>
<strong>Example 1:
Input:</strong>
<b>输入:</b>
+------------+---------+-----+
| student_id | name | age |
+------------+---------+-----+
Expand All @@ -34,14 +36,14 @@ Input:</strong>
| 128 | Henry | 6 |
| 3 | Henry | 11 |
+------------+---------+-----+
<strong>Output:</strong>
<b>输出:</b>
+---------+-----+
| name | age |
+---------+-----+
| Ulysses | 13 |
+---------+-----+
<strong>Explanation:
</strong>Student Ulysses has student_id = 101, we select the name and age.</pre>
<strong>解释:
</strong>学生 Ulysses student_id = 101,所以我们输出了他的 name age</pre>

## 解法

Expand Down
2 changes: 1 addition & 1 deletion solution/2800-2899/2881.Create a New Column/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ DataFrame employees
| Thomas | 24433 | 48866 |
+---------+--------+--------+
<b>解释:</b>
通过将salary列中的值加倍创建了一个新的bonus列。</pre>
通过将 salary 列中的值加倍创建了一个新的 bonus 列。</pre>

## 解法

Expand Down
17 changes: 9 additions & 8 deletions solution/2800-2899/2889.Reshape Data Pivot/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [2889. Reshape Data Pivot](https://leetcode.cn/problems/reshape-data-pivot)
# [2889. 数据重塑:透视](https://leetcode.cn/problems/reshape-data-pivot)

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

Expand All @@ -17,14 +17,15 @@ DataFrame <code>weather</code>
+-------------+--------+
</pre>

<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>
<p>编写一个解决方案,以便将数据&nbsp;<strong>旋转</strong>,使得每一行代表特定月份的温度,而每个城市都是一个单独的列。</p>

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

<p>&nbsp;</p>
<b>示例 1:</b>

<pre>
<strong class="example">Example 1:</strong>
<strong>Input:</strong>
<b>输入:</b>
+--------------+----------+-------------+
| city | month | temperature |
+--------------+----------+-------------+
Expand All @@ -39,7 +40,7 @@ DataFrame <code>weather</code>
| ElPaso | April | 2 |
| ElPaso | May | 43 |
+--------------+----------+-------------+
<strong>Output:</strong><code>
<code><b>输出:</b>
+----------+--------+--------------+
| month | ElPaso | Jacksonville |
+----------+--------+--------------+
Expand All @@ -49,8 +50,8 @@ DataFrame <code>weather</code>
| March | 26 | 38 |
| May | 43 | 34 |
+----------+--------+--------------+</code>
<strong>Explanation:
</strong>The table is pivoted, each column represents a city, and each row represents a specific month.</pre>
<strong>解释:
</strong>表格被旋转,每一列代表一个城市,每一行代表特定的月份。</pre>

## 解法

Expand Down
28 changes: 15 additions & 13 deletions solution/2800-2899/2891.Method Chaining/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [2891. Method Chaining](https://leetcode.cn/problems/method-chaining)
# [2891. 方法链](https://leetcode.cn/problems/method-chaining)

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

Expand All @@ -18,17 +18,18 @@ DataFrame <code>animals</code>
+-------------+--------+
</pre>

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

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

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

<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>

<p><b>示例 1:</b></p>

<pre>
<strong>Input:</strong>
<b>输入:</b>
DataFrame animals:
+----------+---------+-----+--------+
| name | species | age | weight |
Expand All @@ -40,7 +41,7 @@ DataFrame animals:
| Stefan | Bear | 100 | 50 |
| Tommy | Panda | 26 | 349 |
+----------+---------+-----+--------+
<strong>Output:</strong>
<b>输出:</b>
+----------+
| name |
+----------+
Expand All @@ -49,15 +50,16 @@ DataFrame animals:
| Tommy |
| Alex |
+----------+
<strong>Explanation:</strong>
All animals weighing more than 100 should be included in the results table.
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.
The results should be sorted in descending order of weight.</pre>
<b>解释:</b>
所有体重超过 100 的动物都应包含在结果表中。
Tatiana 的体重为 464Jonathan 的体重为 463Tommy 的体重为 349Alex 的体重为 328
结果应按体重降序排序。</pre>

<p>&nbsp;</p>
<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>

<p>Can you complete this&nbsp;task in just <strong>one line </strong>of code using method chaining?</p>
<p>在 Pandas 中,<strong>方法链</strong> 允许我们在 DataFrame 上执行操作,而无需将每个操作拆分成单独的行或创建多个临时变量。</p>

<p>你能用 <strong>一行</strong> 代码的方法链完成这个任务吗?</p>

## 解法

Expand Down
8 changes: 4 additions & 4 deletions solution/JAVASCRIPT_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
| 2629 | [复合函数](/solution/2600-2699/2629.Function%20Composition/README.md) | | 简单 | |
| 2630 | [记忆函数 II](/solution/2600-2699/2630.Memoize%20II/README.md) | | 困难 | |
| 2631 | [分组](/solution/2600-2699/2631.Group%20By/README.md) | | 中等 | |
| 2632 | [柯里化](/solution/2600-2699/2632.Curry/README.md) | | 中等 | 🔒 |
| 2632 | [柯里化](/solution/2600-2699/2632.Curry/README.md) | | 困难 | 🔒 |
| 2633 | [将对象转换为 JSON 字符串](/solution/2600-2699/2633.Convert%20Object%20to%20JSON%20String/README.md) | | 中等 | 🔒 |
| 2634 | [过滤数组中的元素](/solution/2600-2699/2634.Filter%20Elements%20from%20Array/README.md) | | 简单 | |
| 2635 | [转换数组中的每个元素](/solution/2600-2699/2635.Apply%20Transform%20Over%20Each%20Element%20in%20Array/README.md) | | 简单 | |
Expand All @@ -34,9 +34,9 @@
| 2649 | [嵌套数组生成器](/solution/2600-2699/2649.Nested%20Array%20Generator/README.md) | | 中等 | |
| 2650 | [设计可取消函数](/solution/2600-2699/2650.Design%20Cancellable%20Function/README.md) | | 困难 | |
| 2665 | [计数器 II](/solution/2600-2699/2665.Counter%20II/README.md) | | 简单 | |
| 2666 | [只允许一次函数调用](/solution/2600-2699/2666.Allow%20One%20Function%20Call/README.md) | | 简单 | |
| 2666 | [只允许一次函数调用 44](/solution/2600-2699/2666.Allow%20One%20Function%20Call/README.md) | | 简单 | |
| 2667 | [创建 Hello World 函数](/solution/2600-2699/2667.Create%20Hello%20World%20Function/README.md) | | 简单 | |
| 2675 | [将对象数组转换为矩阵](/solution/2600-2699/2675.Array%20of%20Objects%20to%20Matrix/README.md) | | 中等 | 🔒 |
| 2675 | [将对象数组转换为矩阵](/solution/2600-2699/2675.Array%20of%20Objects%20to%20Matrix/README.md) | | 困难 | 🔒 |
| 2676 | [节流](/solution/2600-2699/2676.Throttle/README.md) | | 中等 | 🔒 |
| 2677 | [分块数组](/solution/2600-2699/2677.Chunk%20Array/README.md) | | 简单 | |
| 2690 | [无穷方法对象](/solution/2600-2699/2690.Infinite%20Method%20Object/README.md) | | 简单 | 🔒 |
Expand All @@ -52,7 +52,7 @@
| 2715 | [执行可取消的延迟函数](/solution/2700-2799/2715.Timeout%20Cancellation/README.md) | | 简单 | |
| 2721 | [并行执行异步函数](/solution/2700-2799/2721.Execute%20Asynchronous%20Functions%20in%20Parallel/README.md) | | 中等 | |
| 2722 | [根据 ID 合并两个数组](/solution/2700-2799/2722.Join%20Two%20Arrays%20by%20ID/README.md) | | 中等 | |
| 2723 | [添加两个 Promise 对象](/solution/2700-2799/2723.Add%20Two%20Promises/README.md) | | 简单 | |
| 2723 | [两个 Promise 对象相加](/solution/2700-2799/2723.Add%20Two%20Promises/README.md) | | 简单 | |
| 2724 | [排序方式](/solution/2700-2799/2724.Sort%20By/README.md) | | 简单 | |
| 2725 | [间隔取消](/solution/2700-2799/2725.Interval%20Cancellation/README.md) | | 简单 | |
| 2726 | [使用方法链的计算器](/solution/2700-2799/2726.Calculator%20with%20Method%20Chaining/README.md) | | 简单 | |
Expand Down
4 changes: 2 additions & 2 deletions solution/JAVASCRIPT_README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
| 2629 | [Function Composition](/solution/2600-2699/2629.Function%20Composition/README_EN.md) | | Easy | |
| 2630 | [Memoize II](/solution/2600-2699/2630.Memoize%20II/README_EN.md) | | Hard | |
| 2631 | [Group By](/solution/2600-2699/2631.Group%20By/README_EN.md) | | Medium | |
| 2632 | [Curry](/solution/2600-2699/2632.Curry/README_EN.md) | | Medium | 🔒 |
| 2632 | [Curry](/solution/2600-2699/2632.Curry/README_EN.md) | | Hard | 🔒 |
| 2633 | [Convert Object to JSON String](/solution/2600-2699/2633.Convert%20Object%20to%20JSON%20String/README_EN.md) | | Medium | 🔒 |
| 2634 | [Filter Elements from Array](/solution/2600-2699/2634.Filter%20Elements%20from%20Array/README_EN.md) | | Easy | |
| 2635 | [Apply Transform Over Each Element in Array](/solution/2600-2699/2635.Apply%20Transform%20Over%20Each%20Element%20in%20Array/README_EN.md) | | Easy | |
Expand All @@ -34,7 +34,7 @@ Press <kbd>Control</kbd> + <kbd>F</kbd>(or <kbd>Command</kbd> + <kbd>F</kbd> on
| 2665 | [Counter II](/solution/2600-2699/2665.Counter%20II/README_EN.md) | | Easy | |
| 2666 | [Allow One Function Call](/solution/2600-2699/2666.Allow%20One%20Function%20Call/README_EN.md) | | Easy | |
| 2667 | [Create Hello World Function](/solution/2600-2699/2667.Create%20Hello%20World%20Function/README_EN.md) | | Easy | |
| 2675 | [Array of Objects to Matrix](/solution/2600-2699/2675.Array%20of%20Objects%20to%20Matrix/README_EN.md) | | Medium | 🔒 |
| 2675 | [Array of Objects to Matrix](/solution/2600-2699/2675.Array%20of%20Objects%20to%20Matrix/README_EN.md) | | Hard | 🔒 |
| 2676 | [Throttle](/solution/2600-2699/2676.Throttle/README_EN.md) | | Medium | 🔒 |
| 2677 | [Chunk Array](/solution/2600-2699/2677.Chunk%20Array/README_EN.md) | | Easy | |
| 2690 | [Infinite Method Object](/solution/2600-2699/2690.Infinite%20Method%20Object/README_EN.md) | | Easy | 🔒 |
Expand Down
Loading