From 3e7dcd363a4fdffa54f6102223eee4f3ec8c1c24 Mon Sep 17 00:00:00 2001 From: Libin YANG Date: Mon, 31 Mar 2025 22:29:20 +0000 Subject: [PATCH] chore: update lc problems --- .../README.md | 119 ++++++++++++++++++ .../README_EN.md | 119 ++++++++++++++++++ solution/README.md | 1 + solution/README_EN.md | 1 + 4 files changed, 240 insertions(+) create mode 100644 solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains II/README.md create mode 100644 solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains II/README_EN.md diff --git a/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains II/README.md b/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains II/README.md new file mode 100644 index 0000000000000..91a92d2153813 --- /dev/null +++ b/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains II/README.md @@ -0,0 +1,119 @@ +--- +comments: true +difficulty: 困难 +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains%20II/README.md +--- + + + +# [3506. Find Time Required to Eliminate Bacterial Strains II 🔒](https://leetcode.cn/problems/find-time-required-to-eliminate-bacterial-strains-ii) + +[English Version](/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains%20II/README_EN.md) + +## 题目描述 + + + +

You are given an integer array timeReq and an integer splitTime.

+ +

In the microscopic world of the human body, the immune system faces an extraordinary challenge: combatting a rapidly multiplying bacterial colony that threatens the body's survival.

+ +

Initially, only one white blood cell (WBC) is deployed to eliminate the bacteria. However, the lone WBC quickly realizes it cannot keep up with the bacterial growth rate.

+ +

The WBC devises a clever strategy to fight the bacteria:

+ + + +

You must determine the minimum time required to eliminate all the bacterial strains.

+ +

Note that the bacterial strains can be eliminated in any order.

+ +

 

+

Example 1:

+ +
+

Input: timeReq = [10,4,5], splitTime = 2

+ +

Output: 12

+ +

Explanation:

+ +

The elimination process goes as follows:

+ + +
+ +

Example 2:

+ +
+

Input: timeReq = [10,4], splitTime = 5

+ +

Output:15

+ +

Explanation:

+ +

The elimination process goes as follows:

+ + +
+ +

 

+

Constraints:

+ + + + + +## 解法 + + + +### 方法一 + + + +#### Python3 + +```python + +``` + +#### Java + +```java + +``` + +#### C++ + +```cpp + +``` + +#### Go + +```go + +``` + + + + + + diff --git a/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains II/README_EN.md b/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains II/README_EN.md new file mode 100644 index 0000000000000..bcf5080a94591 --- /dev/null +++ b/solution/3500-3599/3506.Find Time Required to Eliminate Bacterial Strains II/README_EN.md @@ -0,0 +1,119 @@ +--- +comments: true +difficulty: Hard +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains%20II/README_EN.md +--- + + + +# [3506. Find Time Required to Eliminate Bacterial Strains II 🔒](https://leetcode.com/problems/find-time-required-to-eliminate-bacterial-strains-ii) + +[中文文档](/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains%20II/README.md) + +## Description + + + +

You are given an integer array timeReq and an integer splitTime.

+ +

In the microscopic world of the human body, the immune system faces an extraordinary challenge: combatting a rapidly multiplying bacterial colony that threatens the body's survival.

+ +

Initially, only one white blood cell (WBC) is deployed to eliminate the bacteria. However, the lone WBC quickly realizes it cannot keep up with the bacterial growth rate.

+ +

The WBC devises a clever strategy to fight the bacteria:

+ + + +

You must determine the minimum time required to eliminate all the bacterial strains.

+ +

Note that the bacterial strains can be eliminated in any order.

+ +

 

+

Example 1:

+ +
+

Input: timeReq = [10,4,5], splitTime = 2

+ +

Output: 12

+ +

Explanation:

+ +

The elimination process goes as follows:

+ + +
+ +

Example 2:

+ +
+

Input: timeReq = [10,4], splitTime = 5

+ +

Output:15

+ +

Explanation:

+ +

The elimination process goes as follows:

+ + +
+ +

 

+

Constraints:

+ + + + + +## Solutions + + + +### Solution 1 + + + +#### Python3 + +```python + +``` + +#### Java + +```java + +``` + +#### C++ + +```cpp + +``` + +#### Go + +```go + +``` + + + + + + diff --git a/solution/README.md b/solution/README.md index 7931d360384df..7679fdb3c41b3 100644 --- a/solution/README.md +++ b/solution/README.md @@ -3516,6 +3516,7 @@ | 3503 | [子字符串连接后的最长回文串 I](/solution/3500-3599/3503.Longest%20Palindrome%20After%20Substring%20Concatenation%20I/README.md) | | 中等 | 第 443 场周赛 | | 3504 | [子字符串连接后的最长回文串 II](/solution/3500-3599/3504.Longest%20Palindrome%20After%20Substring%20Concatenation%20II/README.md) | | 困难 | 第 443 场周赛 | | 3505 | [使 K 个子数组内元素相等的最少操作数](/solution/3500-3599/3505.Minimum%20Operations%20to%20Make%20Elements%20Within%20K%20Subarrays%20Equal/README.md) | | 困难 | 第 443 场周赛 | +| 3506 | [Find Time Required to Eliminate Bacterial Strains II](/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains%20II/README.md) | | 困难 | 🔒 | ## 版权 diff --git a/solution/README_EN.md b/solution/README_EN.md index 7ffd87a26bc75..def52d26ffde2 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -3514,6 +3514,7 @@ Press Control + F(or Command + F on | 3503 | [Longest Palindrome After Substring Concatenation I](/solution/3500-3599/3503.Longest%20Palindrome%20After%20Substring%20Concatenation%20I/README_EN.md) | | Medium | Weekly Contest 443 | | 3504 | [Longest Palindrome After Substring Concatenation II](/solution/3500-3599/3504.Longest%20Palindrome%20After%20Substring%20Concatenation%20II/README_EN.md) | | Hard | Weekly Contest 443 | | 3505 | [Minimum Operations to Make Elements Within K Subarrays Equal](/solution/3500-3599/3505.Minimum%20Operations%20to%20Make%20Elements%20Within%20K%20Subarrays%20Equal/README_EN.md) | | Hard | Weekly Contest 443 | +| 3506 | [Find Time Required to Eliminate Bacterial Strains II](/solution/3500-3599/3506.Find%20Time%20Required%20to%20Eliminate%20Bacterial%20Strains%20II/README_EN.md) | | Hard | 🔒 | ## Copyright