From 356ee6bc82e3fb4943a3ae4c6a3e19097e369eb5 Mon Sep 17 00:00:00 2001 From: yanglbme Date: Wed, 5 Mar 2025 09:25:00 +0800 Subject: [PATCH] feat: update lc problems --- README.md | 15 ++++-- README_EN.md | 15 ++++-- .../README_EN.md | 4 +- .../README.md | 52 ++++++++++--------- solution/README.md | 2 +- 5 files changed, 54 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index fb03f8b48b1f5..fac8b5005ec39 100644 --- a/README.md +++ b/README.md @@ -191,9 +191,18 @@ https://doocs.github.io/leetcode 1. 将你的变更以 PR 的形式提交过来,项目的维护人员会在第一时间对你的变更进行 review! 1. 你也可以参考帮助文档 https://help.github.com/cn 了解更多细节。 -

how-to-contribute -

+
+ +```mermaid +graph TD; + A[LeetCode 仓库
doocs/leetcode.git] -- 1.Fork(派生) --> B[你的 GitHub 仓库
yourusername/leetcode.git]; + B -- 2.Git 克隆 --> C[本地开发环境]; + C -- 3.创建新分支并修改代码 --> D[本地修改后的代码]; + D -- 4.提交 & 推送到你的仓库 --> B; + B -- 5.提交 Pull Request(合并请求) --> A; +``` + +
[![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) diff --git a/README_EN.md b/README_EN.md index 47ba7fdfb46b0..ec460d3984fa4 100644 --- a/README_EN.md +++ b/README_EN.md @@ -183,9 +183,18 @@ I'm looking for long-term contributors/partners to this repo! Send me [PRs](http 1. Create a pull request with your changes! 1. See [CONTRIBUTING](https://github.com/doocs/.github/blob/main/CONTRIBUTING.md) or [GitHub Help](https://help.github.com/en) for more details. -

how-to-contribute -

+
+ +```mermaid +graph TD; + A[LeetCode Repo
doocs/leetcode.git] -- 1.Fork --> B[Your GitHub Repo
yourusername/leetcode.git]; + B -- 2.Git Clone --> C[Local Machine]; + C -- 3.Create a New Branch & Make Changes --> D[Modify Code Locally]; + D -- 4.Commit & Push to Your Repo --> B; + B -- 5.Create a Pull Request --> A; +``` + +
[![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) diff --git a/solution/2100-2199/2161.Partition Array According to Given Pivot/README_EN.md b/solution/2100-2199/2161.Partition Array According to Given Pivot/README_EN.md index df2a4df3c0f24..74203dee8a6c6 100644 --- a/solution/2100-2199/2161.Partition Array According to Given Pivot/README_EN.md +++ b/solution/2100-2199/2161.Partition Array According to Given Pivot/README_EN.md @@ -40,7 +40,7 @@ tags:
 Input: nums = [9,12,5,10,14,3,10], pivot = 10
 Output: [9,5,3,10,10,12,14]
-Explanation:
+Explanation: 
 The elements 9, 5, and 3 are less than the pivot so they are on the left side of the array.
 The elements 12 and 14 are greater than the pivot so they are on the right side of the array.
 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
 
 Input: nums = [-3,4,3,2], pivot = 2
 Output: [-3,2,4,3]
-Explanation:
+Explanation: 
 The element -3 is less than the pivot so it is on the left side of the array.
 The elements 4 and 3 are greater than the pivot so they are on the right side of the array.
 The relative ordering of the elements less than and greater than pivot is also maintained. [-3] and [4, 3] are the respective orderings.
diff --git a/solution/3400-3499/3476.Maximize Profit from Task Assignment/README.md b/solution/3400-3499/3476.Maximize Profit from Task Assignment/README.md
index 9ae83f16111a0..9a08c33e09a8b 100644
--- a/solution/3400-3499/3476.Maximize Profit from Task Assignment/README.md	
+++ b/solution/3400-3499/3476.Maximize Profit from Task Assignment/README.md	
@@ -6,7 +6,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3476.Ma
 
 
 
-# [3476. Maximize Profit from Task Assignment 🔒](https://leetcode.cn/problems/maximize-profit-from-task-assignment)
+# [3476. 最大化任务分配的利润 🔒](https://leetcode.cn/problems/maximize-profit-from-task-assignment)
 
 [English Version](/solution/3400-3499/3476.Maximize%20Profit%20from%20Task%20Assignment/README_EN.md)
 
@@ -14,61 +14,63 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3476.Ma
 
 
 
-

You are given an integer array workers, where workers[i] represents the skill level of the ith worker. You are also given a 2D integer array tasks, where:

+

给定一个整数数组 workers,其中 workers[i] 表示第 i 个工人的技能等级。同时给定一个 2 维数组 tasks,其中:

    -
  • tasks[i][0] represents the skill requirement needed to complete the task.
  • -
  • tasks[i][1] represents the profit earned from completing the task.
  • +
  • tasks[i][0] 表示完成任务所需的技能要求。
  • +
  • tasks[i][1] 表示完成任务的收益。
-

Each worker can complete at most one task, and they can only take a task if their skill level is equal to the task's skill requirement. An additional worker joins today who can take up any task, regardless of the skill requirement.

+

每一个工人 最多 能完成一个任务,并且只有在他们的技能等级 等于 任务的技能要求时才能获取此任务。今天又有一名 额外 工人加入,他可以承接任何任务,无论 技能要求如何。

-

Return the maximum total profit that can be earned by optimally assigning the tasks to the workers.

+

返回按照最优方式分配任务给工人所能获得的 最大 总利润。

 

-

Example 1:

+ +

示例 1:

-

Input: workers = [1,2,3,4,5], tasks = [[1,100],[2,400],[3,100],[3,400]]

+

输入:workers = [1,2,3,4,5], tasks = [[1,100],[2,400],[3,100],[3,400]]

-

Output: 1000

+

输出:1000

-

Explanation:

+

解释:

    -
  • Worker 0 completes task 0.
  • -
  • Worker 1 completes task 1.
  • -
  • Worker 2 completes task 3.
  • -
  • The additional worker completes task 2.
  • +
  • 工人 0 完成任务 0。
  • +
  • 工人 1 完成任务 1。
  • +
  • 工人 2 完成任务 3。
  • +
  • 额外工人完成任务 2。
-

Example 2:

+

示例 2:

-

Input: workers = [10,10000,100000000], tasks = [[1,100]]

+

输入:workers = [10,10000,100000000], tasks = [[1,100]]

-

Output: 100

+

输出:100

-

Explanation:

+

解释:

-

Since no worker matches the skill requirement, only the additional worker can complete task 0.

+

由于没有工人满足技能需求,只有额外工人能够完成任务 0。

-

Example 3:

+

示例 3:

-

Input: workers = [7], tasks = [[3,3],[3,3]]

+

输入:workers = [7], tasks = [[3,3],[3,3]]

-

Output: 3

+

输出:3

-

Explanation:

+

解释:

-

The additional worker completes task 1. Worker 0 cannot work since no task has a skill requirement of 7.

+

额外工人完成任务 1。由于没有任务的技能需求为 7,工人 0 无法工作。

 

-

Constraints:

+ +

提示:

  • 1 <= workers.length <= 105
  • diff --git a/solution/README.md b/solution/README.md index 0a1559a7b770b..c654966ddc77a 100644 --- a/solution/README.md +++ b/solution/README.md @@ -3486,7 +3486,7 @@ | 3473 | [长度至少为 M 的 K 个子数组之和](/solution/3400-3499/3473.Sum%20of%20K%20Subarrays%20With%20Length%20at%20Least%20M/README.md) | | 中等 | 第 439 场周赛 | | 3474 | [字典序最小的生成字符串](/solution/3400-3499/3474.Lexicographically%20Smallest%20Generated%20String/README.md) | | 困难 | 第 439 场周赛 | | 3475 | [DNA 模式识别](/solution/3400-3499/3475.DNA%20Pattern%20Recognition/README.md) | | 中等 | | -| 3476 | [Maximize Profit from Task Assignment](/solution/3400-3499/3476.Maximize%20Profit%20from%20Task%20Assignment/README.md) | | 中等 | 🔒 | +| 3476 | [最大化任务分配的利润](/solution/3400-3499/3476.Maximize%20Profit%20from%20Task%20Assignment/README.md) | | 中等 | 🔒 | ## 版权