Skip to content

Commit 98f6312

Browse files
authored
feat: update lc problems (#4128)
1 parent 8ec712f commit 98f6312

File tree

5 files changed

+54
-34
lines changed

5 files changed

+54
-34
lines changed

README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,18 @@ https://doocs.github.io/leetcode
191191
1. 将你的变更以 PR 的形式提交过来,项目的维护人员会在第一时间对你的变更进行 review!
192192
1. 你也可以参考帮助文档 https://help.github.com/cn 了解更多细节。
193193

194-
<p align="center">
195-
  <a href="https://github.com/doocs/leetcode"><img src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/leetcode@main/images/how-to-contribute.svg" alt="how-to-contribute"></a>
196-
</p>
194+
<div align="center">
195+
196+
```mermaid
197+
graph TD;
198+
A[LeetCode 仓库 <br> doocs/leetcode.git] -- 1.Fork(派生) --> B[你的 GitHub 仓库 <br> yourusername/leetcode.git];
199+
B -- 2.Git 克隆 --> C[本地开发环境];
200+
C -- 3.创建新分支并修改代码 --> D[本地修改后的代码];
201+
D -- 4.提交 & 推送到你的仓库 --> B;
202+
B -- 5.提交 Pull Request(合并请求) --> A;
203+
```
204+
205+
</div>
197206

198207
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=149001365&machine=basicLinux32gb&location=SoutheastAsia)
199208

README_EN.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,18 @@ I'm looking for long-term contributors/partners to this repo! Send me [PRs](http
183183
1. Create a pull request with your changes!
184184
1. See [CONTRIBUTING](https://github.com/doocs/.github/blob/main/CONTRIBUTING.md) or [GitHub Help](https://help.github.com/en) for more details.
185185

186-
<p align="center">
187-
  <a href="https://github.com/doocs/leetcode"><img src="https://cdn-doocs.oss-cn-shenzhen.aliyuncs.com/gh/doocs/leetcode@main/images/how-to-contribute.svg" alt="how-to-contribute"></a>
188-
</p>
186+
<div align="center">
187+
188+
```mermaid
189+
graph TD;
190+
A[LeetCode Repo <br> doocs/leetcode.git] -- 1.Fork --> B[Your GitHub Repo <br> yourusername/leetcode.git];
191+
B -- 2.Git Clone --> C[Local Machine];
192+
C -- 3.Create a New Branch & Make Changes --> D[Modify Code Locally];
193+
D -- 4.Commit & Push to Your Repo --> B;
194+
B -- 5.Create a Pull Request --> A;
195+
```
196+
197+
</div>
189198

190199
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=149001365&machine=basicLinux32gb&location=EastUs)
191200

solution/2100-2199/2161.Partition Array According to Given Pivot/README_EN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tags:
4040
<pre>
4141
<strong>Input:</strong> nums = [9,12,5,10,14,3,10], pivot = 10
4242
<strong>Output:</strong> [9,5,3,10,10,12,14]
43-
<strong>Explanation:</strong>
43+
<strong>Explanation:</strong>
4444
The elements 9, 5, and 3 are less than the pivot so they are on the left side of the array.
4545
The elements 12 and 14 are greater than the pivot so they are on the right side of the array.
4646
The relative ordering of the elements less than and greater than pivot is also maintained. [9, 5, 3] and [12, 14] are the respective orderings.
@@ -51,7 +51,7 @@ The relative ordering of the elements less than and greater than pivot is also m
5151
<pre>
5252
<strong>Input:</strong> nums = [-3,4,3,2], pivot = 2
5353
<strong>Output:</strong> [-3,2,4,3]
54-
<strong>Explanation:</strong>
54+
<strong>Explanation:</strong>
5555
The element -3 is less than the pivot so it is on the left side of the array.
5656
The elements 4 and 3 are greater than the pivot so they are on the right side of the array.
5757
The relative ordering of the elements less than and greater than pivot is also maintained. [-3] and [4, 3] are the respective orderings.

solution/3400-3499/3476.Maximize Profit from Task Assignment/README.md

+27-25
Original file line numberDiff line numberDiff line change
@@ -6,69 +6,71 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3476.Ma
66

77
<!-- problem:start -->
88

9-
# [3476. Maximize Profit from Task Assignment 🔒](https://leetcode.cn/problems/maximize-profit-from-task-assignment)
9+
# [3476. 最大化任务分配的利润 🔒](https://leetcode.cn/problems/maximize-profit-from-task-assignment)
1010

1111
[English Version](/solution/3400-3499/3476.Maximize%20Profit%20from%20Task%20Assignment/README_EN.md)
1212

1313
## 题目描述
1414

1515
<!-- description:start -->
1616

17-
<p>You are given an integer array <code>workers</code>, where <code>workers[i]</code> represents the skill level of the <code>i<sup>th</sup></code> worker. You are also given a 2D integer array <code>tasks</code>, where:</p>
17+
<p>给定一个整数数组&nbsp;<code>workers</code>,其中&nbsp;<code>workers[i]</code>&nbsp;表示第&nbsp;<code>i</code>&nbsp;个工人的技能等级。同时给定一个 2 维数组&nbsp;<code>tasks</code>,其中:</p>
1818

1919
<ul>
20-
<li><code>tasks[i][0]</code> represents the skill requirement needed to complete the task.</li>
21-
<li><code>tasks[i][1]</code> represents the profit earned from completing the task.</li>
20+
<li><code>tasks[i][0]</code>&nbsp;表示完成任务所需的技能要求。</li>
21+
<li><code>tasks[i][1]</code>&nbsp;表示完成任务的收益。</li>
2222
</ul>
2323

24-
<p>Each worker can complete <strong>at most</strong> one task, and they can only take a task if their skill level is <strong>equal</strong> to the task&#39;s skill requirement. An <strong>additional</strong> worker joins today who can take up <em>any</em> task, <strong>regardless</strong> of the skill requirement.</p>
24+
<p>每一个工人 <strong>最多</strong>&nbsp;能完成一个任务,并且只有在他们的技能等级 <strong>等于</strong>&nbsp;任务的技能要求时才能获取此任务。今天又有一名 <strong>额外</strong> 工人加入,他可以承接任何任务,<strong>无论</strong>&nbsp;技能要求如何。</p>
2525

26-
<p>Return the <strong>maximum</strong> total profit that can be earned by optimally assigning the tasks to the workers.</p>
26+
<p>返回按照最优方式分配任务给工人所能获得的 <strong>最大</strong> 总利润。</p>
2727

2828
<p>&nbsp;</p>
29-
<p><strong class="example">Example 1:</strong></p>
29+
30+
<p><strong class="example">示例 1:</strong></p>
3031

3132
<div class="example-block">
32-
<p><strong>Input:</strong> <span class="example-io">workers = [1,2,3,4,5], tasks = [[1,100],[2,400],[3,100],[3,400]]</span></p>
33+
<p><span class="example-io"><b>输入:</b>workers = [1,2,3,4,5], tasks = [[1,100],[2,400],[3,100],[3,400]]</span></p>
3334

34-
<p><strong>Output:</strong> <span class="example-io">1000</span></p>
35+
<p><span class="example-io"><b>输出:</b>1000</span></p>
3536

36-
<p><strong>Explanation:</strong></p>
37+
<p><strong>解释:</strong></p>
3738

3839
<ul>
39-
<li>Worker 0 completes task 0.</li>
40-
<li>Worker 1 completes task 1.</li>
41-
<li>Worker 2 completes task 3.</li>
42-
<li>The additional worker completes task 2.</li>
40+
<li>工人 0 完成任务 0。</li>
41+
<li>工人 1 完成任务 1。</li>
42+
<li>工人 2 完成任务 3。</li>
43+
<li>额外工人完成任务 2。</li>
4344
</ul>
4445
</div>
4546

46-
<p><strong class="example">Example 2:</strong></p>
47+
<p><strong class="example">示例 2:</strong></p>
4748

4849
<div class="example-block">
49-
<p><strong>Input:</strong> <span class="example-io">workers = [10,10000,100000000], tasks = [[1,100]]</span></p>
50+
<p><span class="example-io"><b>输入:</b>workers = [10,10000,100000000], tasks = [[1,100]]</span></p>
5051

51-
<p><strong>Output:</strong> <span class="example-io">100</span></p>
52+
<p><strong>输出:</strong><span class="example-io">100</span></p>
5253

53-
<p><strong>Explanation:</strong></p>
54+
<p><strong>解释:</strong></p>
5455

55-
<p>Since no worker matches the skill requirement, only the additional worker can complete task 0.</p>
56+
<p>由于没有工人满足技能需求,只有额外工人能够完成任务 0。</p>
5657
</div>
5758

58-
<p><strong class="example">Example 3:</strong></p>
59+
<p><strong class="example">示例 3:</strong></p>
5960

6061
<div class="example-block">
61-
<p><strong>Input:</strong> <span class="example-io">workers = [7], tasks = [[3,3],[3,3]]</span></p>
62+
<p><span class="example-io"><b>输入:</b>workers = [7], tasks = [[3,3],[3,3]]</span></p>
6263

63-
<p><strong>Output:</strong> <span class="example-io">3</span></p>
64+
<p><span class="example-io"><b>输出:</b>3</span></p>
6465

65-
<p><strong>Explanation:</strong></p>
66+
<p><strong>解释:</strong></p>
6667

67-
<p>The additional worker completes task 1. Worker 0 cannot work since no task has a skill requirement of 7.</p>
68+
<p>额外工人完成任务 1。由于没有任务的技能需求为 7,工人 0 无法工作。</p>
6869
</div>
6970

7071
<p>&nbsp;</p>
71-
<p><strong>Constraints:</strong></p>
72+
73+
<p><strong>提示:</strong></p>
7274

7375
<ul>
7476
<li><code>1 &lt;= workers.length &lt;= 10<sup>5</sup></code></li>

solution/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3486,7 +3486,7 @@
34863486
| 3473 | [长度至少为 M 的 K 个子数组之和](/solution/3400-3499/3473.Sum%20of%20K%20Subarrays%20With%20Length%20at%20Least%20M/README.md) | | 中等 | 第 439 场周赛 |
34873487
| 3474 | [字典序最小的生成字符串](/solution/3400-3499/3474.Lexicographically%20Smallest%20Generated%20String/README.md) | | 困难 | 第 439 场周赛 |
34883488
| 3475 | [DNA 模式识别](/solution/3400-3499/3475.DNA%20Pattern%20Recognition/README.md) | | 中等 | |
3489-
| 3476 | [Maximize Profit from Task Assignment](/solution/3400-3499/3476.Maximize%20Profit%20from%20Task%20Assignment/README.md) | | 中等 | 🔒 |
3489+
| 3476 | [最大化任务分配的利润](/solution/3400-3499/3476.Maximize%20Profit%20from%20Task%20Assignment/README.md) | | 中等 | 🔒 |
34903490

34913491
## 版权
34923492

0 commit comments

Comments
 (0)