diff --git a/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README.md b/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README.md index a92b5f6e6ddf8..d508703cf8666 100644 --- a/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README.md +++ b/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3359.Find%20Sorted%20Submatrices%20With%20Maximum%20Element%20at%20Most%20K/README.md +tags: + - 栈 + - 数组 + - 矩阵 + - 单调栈 --- diff --git a/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README_EN.md b/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README_EN.md index 6779b1a29293e..18da256b77c11 100644 --- a/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README_EN.md +++ b/solution/3300-3399/3359.Find Sorted Submatrices With Maximum Element at Most K/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3359.Find%20Sorted%20Submatrices%20With%20Maximum%20Element%20at%20Most%20K/README_EN.md +tags: + - Stack + - Array + - Matrix + - Monotonic Stack --- diff --git a/solution/3300-3399/3360.Stone Removal Game/README.md b/solution/3300-3399/3360.Stone Removal Game/README.md index 1ff91841886d0..115feb9a5b507 100644 --- a/solution/3300-3399/3360.Stone Removal Game/README.md +++ b/solution/3300-3399/3360.Stone Removal Game/README.md @@ -2,6 +2,9 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3360.Stone%20Removal%20Game/README.md +tags: + - 数学 + - 模拟 --- diff --git a/solution/3300-3399/3360.Stone Removal Game/README_EN.md b/solution/3300-3399/3360.Stone Removal Game/README_EN.md index 7380b02222a25..80a507e4d6a26 100644 --- a/solution/3300-3399/3360.Stone Removal Game/README_EN.md +++ b/solution/3300-3399/3360.Stone Removal Game/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3360.Stone%20Removal%20Game/README_EN.md +tags: + - Math + - Simulation --- diff --git a/solution/3300-3399/3361.Shift Distance Between Two Strings/README.md b/solution/3300-3399/3361.Shift Distance Between Two Strings/README.md index b817c838cfded..005758fc94b9b 100644 --- a/solution/3300-3399/3361.Shift Distance Between Two Strings/README.md +++ b/solution/3300-3399/3361.Shift Distance Between Two Strings/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3361.Shift%20Distance%20Between%20Two%20Strings/README.md +tags: + - 数组 + - 字符串 + - 前缀和 --- diff --git a/solution/3300-3399/3361.Shift Distance Between Two Strings/README_EN.md b/solution/3300-3399/3361.Shift Distance Between Two Strings/README_EN.md index f5fc4a673f3d1..cc95aa8e5d4f6 100644 --- a/solution/3300-3399/3361.Shift Distance Between Two Strings/README_EN.md +++ b/solution/3300-3399/3361.Shift Distance Between Two Strings/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3361.Shift%20Distance%20Between%20Two%20Strings/README_EN.md +tags: + - Array + - String + - Prefix Sum --- diff --git a/solution/3300-3399/3362.Zero Array Transformation III/README.md b/solution/3300-3399/3362.Zero Array Transformation III/README.md index 11cda7090bb42..2b91dd159222a 100644 --- a/solution/3300-3399/3362.Zero Array Transformation III/README.md +++ b/solution/3300-3399/3362.Zero Array Transformation III/README.md @@ -2,6 +2,12 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3362.Zero%20Array%20Transformation%20III/README.md +tags: + - 贪心 + - 数组 + - 前缀和 + - 排序 + - 堆(优先队列) --- diff --git a/solution/3300-3399/3362.Zero Array Transformation III/README_EN.md b/solution/3300-3399/3362.Zero Array Transformation III/README_EN.md index f0b7ba63b6692..6200fd87ac458 100644 --- a/solution/3300-3399/3362.Zero Array Transformation III/README_EN.md +++ b/solution/3300-3399/3362.Zero Array Transformation III/README_EN.md @@ -2,6 +2,12 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3362.Zero%20Array%20Transformation%20III/README_EN.md +tags: + - Greedy + - Array + - Prefix Sum + - Sorting + - Heap (Priority Queue) --- diff --git a/solution/3300-3399/3363.Find the Maximum Number of Fruits Collected/README.md b/solution/3300-3399/3363.Find the Maximum Number of Fruits Collected/README.md index 2860ce276d20b..796cc4dd0df3e 100644 --- a/solution/3300-3399/3363.Find the Maximum Number of Fruits Collected/README.md +++ b/solution/3300-3399/3363.Find the Maximum Number of Fruits Collected/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3363.Find%20the%20Maximum%20Number%20of%20Fruits%20Collected/README.md +tags: + - 数组 + - 动态规划 + - 矩阵 --- diff --git a/solution/3300-3399/3363.Find the Maximum Number of Fruits Collected/README_EN.md b/solution/3300-3399/3363.Find the Maximum Number of Fruits Collected/README_EN.md index 93cc8f77235d6..8ebb95475652a 100644 --- a/solution/3300-3399/3363.Find the Maximum Number of Fruits Collected/README_EN.md +++ b/solution/3300-3399/3363.Find the Maximum Number of Fruits Collected/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3363.Find%20the%20Maximum%20Number%20of%20Fruits%20Collected/README_EN.md +tags: + - Array + - Dynamic Programming + - Matrix --- diff --git a/solution/3300-3399/3364.Minimum Positive Sum Subarray/README.md b/solution/3300-3399/3364.Minimum Positive Sum Subarray/README.md index f2c2a85253df0..5a1fb0fa30b23 100644 --- a/solution/3300-3399/3364.Minimum Positive Sum Subarray/README.md +++ b/solution/3300-3399/3364.Minimum Positive Sum Subarray/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3364.Minimum%20Positive%20Sum%20Subarray/README.md +tags: + - 数组 + - 前缀和 + - 滑动窗口 --- diff --git a/solution/3300-3399/3364.Minimum Positive Sum Subarray/README_EN.md b/solution/3300-3399/3364.Minimum Positive Sum Subarray/README_EN.md index 0403d449c4e6d..6ad80de114c2f 100644 --- a/solution/3300-3399/3364.Minimum Positive Sum Subarray/README_EN.md +++ b/solution/3300-3399/3364.Minimum Positive Sum Subarray/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3364.Minimum%20Positive%20Sum%20Subarray/README_EN.md +tags: + - Array + - Prefix Sum + - Sliding Window --- diff --git a/solution/3300-3399/3365.Rearrange K Substrings to Form Target String/README.md b/solution/3300-3399/3365.Rearrange K Substrings to Form Target String/README.md index 7eaeb18825e7d..2309a626c435f 100644 --- a/solution/3300-3399/3365.Rearrange K Substrings to Form Target String/README.md +++ b/solution/3300-3399/3365.Rearrange K Substrings to Form Target String/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3365.Rearrange%20K%20Substrings%20to%20Form%20Target%20String/README.md +tags: + - 哈希表 + - 字符串 + - 排序 --- diff --git a/solution/3300-3399/3365.Rearrange K Substrings to Form Target String/README_EN.md b/solution/3300-3399/3365.Rearrange K Substrings to Form Target String/README_EN.md index b8b9fbd1ff794..c016ec7048a34 100644 --- a/solution/3300-3399/3365.Rearrange K Substrings to Form Target String/README_EN.md +++ b/solution/3300-3399/3365.Rearrange K Substrings to Form Target String/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3365.Rearrange%20K%20Substrings%20to%20Form%20Target%20String/README_EN.md +tags: + - Hash Table + - String + - Sorting --- diff --git a/solution/3300-3399/3366.Minimum Array Sum/README.md b/solution/3300-3399/3366.Minimum Array Sum/README.md index 0a0c974d036e4..c28561028d524 100644 --- a/solution/3300-3399/3366.Minimum Array Sum/README.md +++ b/solution/3300-3399/3366.Minimum Array Sum/README.md @@ -2,6 +2,9 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3366.Minimum%20Array%20Sum/README.md +tags: + - 数组 + - 动态规划 --- diff --git a/solution/3300-3399/3366.Minimum Array Sum/README_EN.md b/solution/3300-3399/3366.Minimum Array Sum/README_EN.md index be7b2e9c876cb..2e8d959b1830f 100644 --- a/solution/3300-3399/3366.Minimum Array Sum/README_EN.md +++ b/solution/3300-3399/3366.Minimum Array Sum/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3366.Minimum%20Array%20Sum/README_EN.md +tags: + - Array + - Dynamic Programming --- diff --git a/solution/3300-3399/3367.Maximize Sum of Weights after Edge Removals/README.md b/solution/3300-3399/3367.Maximize Sum of Weights after Edge Removals/README.md index 6653c6e4267b6..599300bc54e3e 100644 --- a/solution/3300-3399/3367.Maximize Sum of Weights after Edge Removals/README.md +++ b/solution/3300-3399/3367.Maximize Sum of Weights after Edge Removals/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3367.Maximize%20Sum%20of%20Weights%20after%20Edge%20Removals/README.md +tags: + - 树 + - 深度优先搜索 + - 动态规划 --- diff --git a/solution/3300-3399/3367.Maximize Sum of Weights after Edge Removals/README_EN.md b/solution/3300-3399/3367.Maximize Sum of Weights after Edge Removals/README_EN.md index 358158b9ff93f..9177d9e63ef61 100644 --- a/solution/3300-3399/3367.Maximize Sum of Weights after Edge Removals/README_EN.md +++ b/solution/3300-3399/3367.Maximize Sum of Weights after Edge Removals/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3367.Maximize%20Sum%20of%20Weights%20after%20Edge%20Removals/README_EN.md +tags: + - Tree + - Depth-First Search + - Dynamic Programming --- diff --git a/solution/3300-3399/3369.Design an Array Statistics Tracker/README.md b/solution/3300-3399/3369.Design an Array Statistics Tracker/README.md new file mode 100644 index 0000000000000..6ff0e6599ffaa --- /dev/null +++ b/solution/3300-3399/3369.Design an Array Statistics Tracker/README.md @@ -0,0 +1,135 @@ +--- +comments: true +difficulty: 困难 +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3369.Design%20an%20Array%20Statistics%20Tracker/README.md +tags: + - 队列 + - 哈希表 + - 二分查找 +--- + + + +# [3369. Design an Array Statistics Tracker 🔒](https://leetcode.cn/problems/design-an-array-statistics-tracker) + +[English Version](/solution/3300-3399/3369.Design%20an%20Array%20Statistics%20Tracker/README_EN.md) + +## 题目描述 + + + +

Design a data structure that keeps track of the values in it and answers some queries regarding their mean, median, and mode.

+ +

Implement the StatisticsTracker class.

+ + + +

Note:

+ + + +

 

+

Example 1:

+ +
+

Input:
+["StatisticsTracker", "addNumber", "addNumber", "addNumber", "addNumber", "getMean", "getMedian", "getMode", "removeFirstAddedNumber", "getMode"]
+[[], [4], [4], [2], [3], [], [], [], [], []]

+ +

Output:
+[null, null, null, null, null, 3, 4, 4, null, 2]

+ +

Explanation

+StatisticsTracker statisticsTracker = new StatisticsTracker();
+statisticsTracker.addNumber(4); // The data structure now contains [4]
+statisticsTracker.addNumber(4); // The data structure now contains [4, 4]
+statisticsTracker.addNumber(2); // The data structure now contains [4, 4, 2]
+statisticsTracker.addNumber(3); // The data structure now contains [4, 4, 2, 3]
+statisticsTracker.getMean(); // return 3
+statisticsTracker.getMedian(); // return 4
+statisticsTracker.getMode(); // return 4
+statisticsTracker.removeFirstAddedNumber(); // The data structure now contains [4, 2, 3]
+statisticsTracker.getMode(); // return 2
+ +

Example 2:

+ +
+

Input:
+["StatisticsTracker", "addNumber", "addNumber", "getMean", "removeFirstAddedNumber", "addNumber", "addNumber", "removeFirstAddedNumber", "getMedian", "addNumber", "getMode"]
+[[], [9], [5], [], [], [5], [6], [], [], [8], []]

+ +

Output:
+[null, null, null, 7, null, null, null, null, 6, null, 5]

+ +

Explanation

+StatisticsTracker statisticsTracker = new StatisticsTracker();
+statisticsTracker.addNumber(9); // The data structure now contains [9]
+statisticsTracker.addNumber(5); // The data structure now contains [9, 5]
+statisticsTracker.getMean(); // return 7
+statisticsTracker.removeFirstAddedNumber(); // The data structure now contains [5]
+statisticsTracker.addNumber(5); // The data structure now contains [5, 5]
+statisticsTracker.addNumber(6); // The data structure now contains [5, 5, 6]
+statisticsTracker.removeFirstAddedNumber(); // The data structure now contains [5, 6]
+statisticsTracker.getMedian(); // return 6
+statisticsTracker.addNumber(8); // The data structure now contains [5, 6, 8]
+statisticsTracker.getMode(); // return 5
+ +

 

+

Constraints:

+ + + + + +## 解法 + + + +### 方法一 + + + +#### Python3 + +```python + +``` + +#### Java + +```java + +``` + +#### C++ + +```cpp + +``` + +#### Go + +```go + +``` + + + + + + diff --git a/solution/3300-3399/3369.Design an Array Statistics Tracker/README_EN.md b/solution/3300-3399/3369.Design an Array Statistics Tracker/README_EN.md new file mode 100644 index 0000000000000..9e93150d6c3c0 --- /dev/null +++ b/solution/3300-3399/3369.Design an Array Statistics Tracker/README_EN.md @@ -0,0 +1,135 @@ +--- +comments: true +difficulty: Hard +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3369.Design%20an%20Array%20Statistics%20Tracker/README_EN.md +tags: + - Queue + - Hash Table + - Binary Search +--- + + + +# [3369. Design an Array Statistics Tracker 🔒](https://leetcode.com/problems/design-an-array-statistics-tracker) + +[中文文档](/solution/3300-3399/3369.Design%20an%20Array%20Statistics%20Tracker/README.md) + +## Description + + + +

Design a data structure that keeps track of the values in it and answers some queries regarding their mean, median, and mode.

+ +

Implement the StatisticsTracker class.

+ + + +

Note:

+ + + +

 

+

Example 1:

+ +
+

Input:
+["StatisticsTracker", "addNumber", "addNumber", "addNumber", "addNumber", "getMean", "getMedian", "getMode", "removeFirstAddedNumber", "getMode"]
+[[], [4], [4], [2], [3], [], [], [], [], []]

+ +

Output:
+[null, null, null, null, null, 3, 4, 4, null, 2]

+ +

Explanation

+StatisticsTracker statisticsTracker = new StatisticsTracker();
+statisticsTracker.addNumber(4); // The data structure now contains [4]
+statisticsTracker.addNumber(4); // The data structure now contains [4, 4]
+statisticsTracker.addNumber(2); // The data structure now contains [4, 4, 2]
+statisticsTracker.addNumber(3); // The data structure now contains [4, 4, 2, 3]
+statisticsTracker.getMean(); // return 3
+statisticsTracker.getMedian(); // return 4
+statisticsTracker.getMode(); // return 4
+statisticsTracker.removeFirstAddedNumber(); // The data structure now contains [4, 2, 3]
+statisticsTracker.getMode(); // return 2
+ +

Example 2:

+ +
+

Input:
+["StatisticsTracker", "addNumber", "addNumber", "getMean", "removeFirstAddedNumber", "addNumber", "addNumber", "removeFirstAddedNumber", "getMedian", "addNumber", "getMode"]
+[[], [9], [5], [], [], [5], [6], [], [], [8], []]

+ +

Output:
+[null, null, null, 7, null, null, null, null, 6, null, 5]

+ +

Explanation

+StatisticsTracker statisticsTracker = new StatisticsTracker();
+statisticsTracker.addNumber(9); // The data structure now contains [9]
+statisticsTracker.addNumber(5); // The data structure now contains [9, 5]
+statisticsTracker.getMean(); // return 7
+statisticsTracker.removeFirstAddedNumber(); // The data structure now contains [5]
+statisticsTracker.addNumber(5); // The data structure now contains [5, 5]
+statisticsTracker.addNumber(6); // The data structure now contains [5, 5, 6]
+statisticsTracker.removeFirstAddedNumber(); // The data structure now contains [5, 6]
+statisticsTracker.getMedian(); // return 6
+statisticsTracker.addNumber(8); // The data structure now contains [5, 6, 8]
+statisticsTracker.getMode(); // return 5
+ +

 

+

Constraints:

+ + + + + +## Solutions + + + +### Solution 1 + + + +#### Python3 + +```python + +``` + +#### Java + +```java + +``` + +#### C++ + +```cpp + +``` + +#### Go + +```go + +``` + + + + + + diff --git a/solution/3300-3399/3370.Smallest Number With All Set Bits/README.md b/solution/3300-3399/3370.Smallest Number With All Set Bits/README.md index f8bf400ca15e2..7f19592c20e27 100644 --- a/solution/3300-3399/3370.Smallest Number With All Set Bits/README.md +++ b/solution/3300-3399/3370.Smallest Number With All Set Bits/README.md @@ -2,6 +2,9 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3370.Smallest%20Number%20With%20All%20Set%20Bits/README.md +tags: + - 位运算 + - 数学 --- diff --git a/solution/3300-3399/3370.Smallest Number With All Set Bits/README_EN.md b/solution/3300-3399/3370.Smallest Number With All Set Bits/README_EN.md index 960c069a1d9d9..8db2b834e92dc 100644 --- a/solution/3300-3399/3370.Smallest Number With All Set Bits/README_EN.md +++ b/solution/3300-3399/3370.Smallest Number With All Set Bits/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3370.Smallest%20Number%20With%20All%20Set%20Bits/README_EN.md +tags: + - Bit Manipulation + - Math --- diff --git a/solution/3300-3399/3371.Identify the Largest Outlier in an Array/README.md b/solution/3300-3399/3371.Identify the Largest Outlier in an Array/README.md index 1e833011dedf0..0cb3625e952d9 100644 --- a/solution/3300-3399/3371.Identify the Largest Outlier in an Array/README.md +++ b/solution/3300-3399/3371.Identify the Largest Outlier in an Array/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3371.Identify%20the%20Largest%20Outlier%20in%20an%20Array/README.md +tags: + - 数组 + - 哈希表 + - 计数 + - 枚举 --- diff --git a/solution/3300-3399/3371.Identify the Largest Outlier in an Array/README_EN.md b/solution/3300-3399/3371.Identify the Largest Outlier in an Array/README_EN.md index 00df472823075..467f57b5ce8a0 100644 --- a/solution/3300-3399/3371.Identify the Largest Outlier in an Array/README_EN.md +++ b/solution/3300-3399/3371.Identify the Largest Outlier in an Array/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3371.Identify%20the%20Largest%20Outlier%20in%20an%20Array/README_EN.md +tags: + - Array + - Hash Table + - Counting + - Enumeration --- diff --git a/solution/3300-3399/3372.Maximize the Number of Target Nodes After Connecting Trees I/README.md b/solution/3300-3399/3372.Maximize the Number of Target Nodes After Connecting Trees I/README.md index 2bdb7f33f805f..aee522ce46e03 100644 --- a/solution/3300-3399/3372.Maximize the Number of Target Nodes After Connecting Trees I/README.md +++ b/solution/3300-3399/3372.Maximize the Number of Target Nodes After Connecting Trees I/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3372.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20I/README.md +tags: + - 树 + - 深度优先搜索 + - 广度优先搜索 --- diff --git a/solution/3300-3399/3372.Maximize the Number of Target Nodes After Connecting Trees I/README_EN.md b/solution/3300-3399/3372.Maximize the Number of Target Nodes After Connecting Trees I/README_EN.md index f1dad637fab31..dcd91a4fbcac1 100644 --- a/solution/3300-3399/3372.Maximize the Number of Target Nodes After Connecting Trees I/README_EN.md +++ b/solution/3300-3399/3372.Maximize the Number of Target Nodes After Connecting Trees I/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3372.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20I/README_EN.md +tags: + - Tree + - Depth-First Search + - Breadth-First Search --- diff --git a/solution/3300-3399/3373.Maximize the Number of Target Nodes After Connecting Trees II/README.md b/solution/3300-3399/3373.Maximize the Number of Target Nodes After Connecting Trees II/README.md index 6209616546477..a6bef2a9f92fa 100644 --- a/solution/3300-3399/3373.Maximize the Number of Target Nodes After Connecting Trees II/README.md +++ b/solution/3300-3399/3373.Maximize the Number of Target Nodes After Connecting Trees II/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3373.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20II/README.md +tags: + - 树 + - 深度优先搜索 + - 广度优先搜索 --- diff --git a/solution/3300-3399/3373.Maximize the Number of Target Nodes After Connecting Trees II/README_EN.md b/solution/3300-3399/3373.Maximize the Number of Target Nodes After Connecting Trees II/README_EN.md index 9b9caa18ccff3..3ee12e3bf90e0 100644 --- a/solution/3300-3399/3373.Maximize the Number of Target Nodes After Connecting Trees II/README_EN.md +++ b/solution/3300-3399/3373.Maximize the Number of Target Nodes After Connecting Trees II/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3373.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20II/README_EN.md +tags: + - Tree + - Depth-First Search + - Breadth-First Search --- diff --git a/solution/DATABASE_README.md b/solution/DATABASE_README.md index d31563ff0c7bb..084768cf1017b 100644 --- a/solution/DATABASE_README.md +++ b/solution/DATABASE_README.md @@ -301,8 +301,8 @@ | 3328 | [查找每个州的城市 II](/solution/3300-3399/3328.Find%20Cities%20in%20Each%20State%20II/README.md) | `数据库` | 中等 | 🔒 | | 3338 | [第二高的薪水 II](/solution/3300-3399/3338.Second%20Highest%20Salary%20II/README.md) | `数据库` | 中等 | 🔒 | | 3358 | [评分为 NULL 的图书](/solution/3300-3399/3358.Books%20with%20NULL%20Ratings/README.md) | `数据库` | 简单 | 🔒 | -| 3368 | [首字母大写](/solution/3300-3399/3368.First%20Letter%20Capitalization/README.md) | | 困难 | 🔒 | -| 3374 | [首字母大写 II](/solution/3300-3399/3374.First%20Letter%20Capitalization%20II/README.md) | | 困难 | | +| 3368 | [首字母大写](/solution/3300-3399/3368.First%20Letter%20Capitalization/README.md) | `数据库` | 困难 | 🔒 | +| 3374 | [首字母大写 II](/solution/3300-3399/3374.First%20Letter%20Capitalization%20II/README.md) | `数据库` | 困难 | | ## 版权 diff --git a/solution/DATABASE_README_EN.md b/solution/DATABASE_README_EN.md index 9c84166e26edd..79095256223f4 100644 --- a/solution/DATABASE_README_EN.md +++ b/solution/DATABASE_README_EN.md @@ -299,8 +299,8 @@ Press Control + F(or Command + F on | 3328 | [Find Cities in Each State II](/solution/3300-3399/3328.Find%20Cities%20in%20Each%20State%20II/README_EN.md) | `Database` | Medium | 🔒 | | 3338 | [Second Highest Salary II](/solution/3300-3399/3338.Second%20Highest%20Salary%20II/README_EN.md) | `Database` | Medium | 🔒 | | 3358 | [Books with NULL Ratings](/solution/3300-3399/3358.Books%20with%20NULL%20Ratings/README_EN.md) | `Database` | Easy | 🔒 | -| 3368 | [First Letter Capitalization](/solution/3300-3399/3368.First%20Letter%20Capitalization/README_EN.md) | | Hard | 🔒 | -| 3374 | [First Letter Capitalization II](/solution/3300-3399/3374.First%20Letter%20Capitalization%20II/README_EN.md) | | Hard | | +| 3368 | [First Letter Capitalization](/solution/3300-3399/3368.First%20Letter%20Capitalization/README_EN.md) | `Database` | Hard | 🔒 | +| 3374 | [First Letter Capitalization II](/solution/3300-3399/3374.First%20Letter%20Capitalization%20II/README_EN.md) | `Database` | Hard | | ## Copyright diff --git a/solution/README.md b/solution/README.md index edc651471aafc..9e1085d0ee8e1 100644 --- a/solution/README.md +++ b/solution/README.md @@ -3369,21 +3369,22 @@ | 3356 | [零数组变换 II](/solution/3300-3399/3356.Zero%20Array%20Transformation%20II/README.md) | `数组`,`二分查找`,`前缀和` | 中等 | 第 424 场周赛 | | 3357 | [最小化相邻元素的最大差值](/solution/3300-3399/3357.Minimize%20the%20Maximum%20Adjacent%20Element%20Difference/README.md) | `贪心`,`数组`,`二分查找` | 困难 | 第 424 场周赛 | | 3358 | [评分为 NULL 的图书](/solution/3300-3399/3358.Books%20with%20NULL%20Ratings/README.md) | `数据库` | 简单 | 🔒 | -| 3359 | [查找最大元素不超过 K 的有序子矩阵](/solution/3300-3399/3359.Find%20Sorted%20Submatrices%20With%20Maximum%20Element%20at%20Most%20K/README.md) | | 困难 | 🔒 | -| 3360 | [移除石头游戏](/solution/3300-3399/3360.Stone%20Removal%20Game/README.md) | | 简单 | 第 144 场双周赛 | -| 3361 | [两个字符串的切换距离](/solution/3300-3399/3361.Shift%20Distance%20Between%20Two%20Strings/README.md) | | 中等 | 第 144 场双周赛 | -| 3362 | [零数组变换 III](/solution/3300-3399/3362.Zero%20Array%20Transformation%20III/README.md) | | 中等 | 第 144 场双周赛 | -| 3363 | [最多可收集的水果数目](/solution/3300-3399/3363.Find%20the%20Maximum%20Number%20of%20Fruits%20Collected/README.md) | | 困难 | 第 144 场双周赛 | -| 3364 | [最小正和子数组](/solution/3300-3399/3364.Minimum%20Positive%20Sum%20Subarray/README.md) | | 简单 | 第 425 场周赛 | -| 3365 | [重排子字符串以形成目标字符串](/solution/3300-3399/3365.Rearrange%20K%20Substrings%20to%20Form%20Target%20String/README.md) | | 中等 | 第 425 场周赛 | -| 3366 | [最小数组和](/solution/3300-3399/3366.Minimum%20Array%20Sum/README.md) | | 中等 | 第 425 场周赛 | -| 3367 | [移除边之后的权重最大和](/solution/3300-3399/3367.Maximize%20Sum%20of%20Weights%20after%20Edge%20Removals/README.md) | | 困难 | 第 425 场周赛 | -| 3368 | [首字母大写](/solution/3300-3399/3368.First%20Letter%20Capitalization/README.md) | | 困难 | 🔒 | -| 3370 | [仅含置位位的最小整数](/solution/3300-3399/3370.Smallest%20Number%20With%20All%20Set%20Bits/README.md) | | 简单 | 第 426 场周赛 | -| 3371 | [识别数组中的最大异常值](/solution/3300-3399/3371.Identify%20the%20Largest%20Outlier%20in%20an%20Array/README.md) | | 中等 | 第 426 场周赛 | -| 3372 | [连接两棵树后最大目标节点数目 I](/solution/3300-3399/3372.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20I/README.md) | | 中等 | 第 426 场周赛 | -| 3373 | [连接两棵树后最大目标节点数目 II](/solution/3300-3399/3373.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20II/README.md) | | 困难 | 第 426 场周赛 | -| 3374 | [首字母大写 II](/solution/3300-3399/3374.First%20Letter%20Capitalization%20II/README.md) | | 困难 | | +| 3359 | [查找最大元素不超过 K 的有序子矩阵](/solution/3300-3399/3359.Find%20Sorted%20Submatrices%20With%20Maximum%20Element%20at%20Most%20K/README.md) | `栈`,`数组`,`矩阵`,`单调栈` | 困难 | 🔒 | +| 3360 | [移除石头游戏](/solution/3300-3399/3360.Stone%20Removal%20Game/README.md) | `数学`,`模拟` | 简单 | 第 144 场双周赛 | +| 3361 | [两个字符串的切换距离](/solution/3300-3399/3361.Shift%20Distance%20Between%20Two%20Strings/README.md) | `数组`,`字符串`,`前缀和` | 中等 | 第 144 场双周赛 | +| 3362 | [零数组变换 III](/solution/3300-3399/3362.Zero%20Array%20Transformation%20III/README.md) | `贪心`,`数组`,`前缀和`,`排序`,`堆(优先队列)` | 中等 | 第 144 场双周赛 | +| 3363 | [最多可收集的水果数目](/solution/3300-3399/3363.Find%20the%20Maximum%20Number%20of%20Fruits%20Collected/README.md) | `数组`,`动态规划`,`矩阵` | 困难 | 第 144 场双周赛 | +| 3364 | [最小正和子数组](/solution/3300-3399/3364.Minimum%20Positive%20Sum%20Subarray/README.md) | `数组`,`前缀和`,`滑动窗口` | 简单 | 第 425 场周赛 | +| 3365 | [重排子字符串以形成目标字符串](/solution/3300-3399/3365.Rearrange%20K%20Substrings%20to%20Form%20Target%20String/README.md) | `哈希表`,`字符串`,`排序` | 中等 | 第 425 场周赛 | +| 3366 | [最小数组和](/solution/3300-3399/3366.Minimum%20Array%20Sum/README.md) | `数组`,`动态规划` | 中等 | 第 425 场周赛 | +| 3367 | [移除边之后的权重最大和](/solution/3300-3399/3367.Maximize%20Sum%20of%20Weights%20after%20Edge%20Removals/README.md) | `树`,`深度优先搜索`,`动态规划` | 困难 | 第 425 场周赛 | +| 3368 | [首字母大写](/solution/3300-3399/3368.First%20Letter%20Capitalization/README.md) | `数据库` | 困难 | 🔒 | +| 3369 | [Design an Array Statistics Tracker](/solution/3300-3399/3369.Design%20an%20Array%20Statistics%20Tracker/README.md) | `队列`,`哈希表`,`二分查找` | 困难 | 🔒 | +| 3370 | [仅含置位位的最小整数](/solution/3300-3399/3370.Smallest%20Number%20With%20All%20Set%20Bits/README.md) | `位运算`,`数学` | 简单 | 第 426 场周赛 | +| 3371 | [识别数组中的最大异常值](/solution/3300-3399/3371.Identify%20the%20Largest%20Outlier%20in%20an%20Array/README.md) | `数组`,`哈希表`,`计数`,`枚举` | 中等 | 第 426 场周赛 | +| 3372 | [连接两棵树后最大目标节点数目 I](/solution/3300-3399/3372.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20I/README.md) | `树`,`深度优先搜索`,`广度优先搜索` | 中等 | 第 426 场周赛 | +| 3373 | [连接两棵树后最大目标节点数目 II](/solution/3300-3399/3373.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20II/README.md) | `树`,`深度优先搜索`,`广度优先搜索` | 困难 | 第 426 场周赛 | +| 3374 | [首字母大写 II](/solution/3300-3399/3374.First%20Letter%20Capitalization%20II/README.md) | `数据库` | 困难 | | ## 版权 diff --git a/solution/README_EN.md b/solution/README_EN.md index f46cc766ff512..c1b4de5077aa3 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -3367,21 +3367,22 @@ Press Control + F(or Command + F on | 3356 | [Zero Array Transformation II](/solution/3300-3399/3356.Zero%20Array%20Transformation%20II/README_EN.md) | `Array`,`Binary Search`,`Prefix Sum` | Medium | Weekly Contest 424 | | 3357 | [Minimize the Maximum Adjacent Element Difference](/solution/3300-3399/3357.Minimize%20the%20Maximum%20Adjacent%20Element%20Difference/README_EN.md) | `Greedy`,`Array`,`Binary Search` | Hard | Weekly Contest 424 | | 3358 | [Books with NULL Ratings](/solution/3300-3399/3358.Books%20with%20NULL%20Ratings/README_EN.md) | `Database` | Easy | 🔒 | -| 3359 | [Find Sorted Submatrices With Maximum Element at Most K](/solution/3300-3399/3359.Find%20Sorted%20Submatrices%20With%20Maximum%20Element%20at%20Most%20K/README_EN.md) | | Hard | 🔒 | -| 3360 | [Stone Removal Game](/solution/3300-3399/3360.Stone%20Removal%20Game/README_EN.md) | | Easy | Biweekly Contest 144 | -| 3361 | [Shift Distance Between Two Strings](/solution/3300-3399/3361.Shift%20Distance%20Between%20Two%20Strings/README_EN.md) | | Medium | Biweekly Contest 144 | -| 3362 | [Zero Array Transformation III](/solution/3300-3399/3362.Zero%20Array%20Transformation%20III/README_EN.md) | | Medium | Biweekly Contest 144 | -| 3363 | [Find the Maximum Number of Fruits Collected](/solution/3300-3399/3363.Find%20the%20Maximum%20Number%20of%20Fruits%20Collected/README_EN.md) | | Hard | Biweekly Contest 144 | -| 3364 | [Minimum Positive Sum Subarray](/solution/3300-3399/3364.Minimum%20Positive%20Sum%20Subarray/README_EN.md) | | Easy | Weekly Contest 425 | -| 3365 | [Rearrange K Substrings to Form Target String](/solution/3300-3399/3365.Rearrange%20K%20Substrings%20to%20Form%20Target%20String/README_EN.md) | | Medium | Weekly Contest 425 | -| 3366 | [Minimum Array Sum](/solution/3300-3399/3366.Minimum%20Array%20Sum/README_EN.md) | | Medium | Weekly Contest 425 | -| 3367 | [Maximize Sum of Weights after Edge Removals](/solution/3300-3399/3367.Maximize%20Sum%20of%20Weights%20after%20Edge%20Removals/README_EN.md) | | Hard | Weekly Contest 425 | -| 3368 | [First Letter Capitalization](/solution/3300-3399/3368.First%20Letter%20Capitalization/README_EN.md) | | Hard | 🔒 | -| 3370 | [Smallest Number With All Set Bits](/solution/3300-3399/3370.Smallest%20Number%20With%20All%20Set%20Bits/README_EN.md) | | Easy | Weekly Contest 426 | -| 3371 | [Identify the Largest Outlier in an Array](/solution/3300-3399/3371.Identify%20the%20Largest%20Outlier%20in%20an%20Array/README_EN.md) | | Medium | Weekly Contest 426 | -| 3372 | [Maximize the Number of Target Nodes After Connecting Trees I](/solution/3300-3399/3372.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20I/README_EN.md) | | Medium | Weekly Contest 426 | -| 3373 | [Maximize the Number of Target Nodes After Connecting Trees II](/solution/3300-3399/3373.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20II/README_EN.md) | | Hard | Weekly Contest 426 | -| 3374 | [First Letter Capitalization II](/solution/3300-3399/3374.First%20Letter%20Capitalization%20II/README_EN.md) | | Hard | | +| 3359 | [Find Sorted Submatrices With Maximum Element at Most K](/solution/3300-3399/3359.Find%20Sorted%20Submatrices%20With%20Maximum%20Element%20at%20Most%20K/README_EN.md) | `Stack`,`Array`,`Matrix`,`Monotonic Stack` | Hard | 🔒 | +| 3360 | [Stone Removal Game](/solution/3300-3399/3360.Stone%20Removal%20Game/README_EN.md) | `Math`,`Simulation` | Easy | Biweekly Contest 144 | +| 3361 | [Shift Distance Between Two Strings](/solution/3300-3399/3361.Shift%20Distance%20Between%20Two%20Strings/README_EN.md) | `Array`,`String`,`Prefix Sum` | Medium | Biweekly Contest 144 | +| 3362 | [Zero Array Transformation III](/solution/3300-3399/3362.Zero%20Array%20Transformation%20III/README_EN.md) | `Greedy`,`Array`,`Prefix Sum`,`Sorting`,`Heap (Priority Queue)` | Medium | Biweekly Contest 144 | +| 3363 | [Find the Maximum Number of Fruits Collected](/solution/3300-3399/3363.Find%20the%20Maximum%20Number%20of%20Fruits%20Collected/README_EN.md) | `Array`,`Dynamic Programming`,`Matrix` | Hard | Biweekly Contest 144 | +| 3364 | [Minimum Positive Sum Subarray](/solution/3300-3399/3364.Minimum%20Positive%20Sum%20Subarray/README_EN.md) | `Array`,`Prefix Sum`,`Sliding Window` | Easy | Weekly Contest 425 | +| 3365 | [Rearrange K Substrings to Form Target String](/solution/3300-3399/3365.Rearrange%20K%20Substrings%20to%20Form%20Target%20String/README_EN.md) | `Hash Table`,`String`,`Sorting` | Medium | Weekly Contest 425 | +| 3366 | [Minimum Array Sum](/solution/3300-3399/3366.Minimum%20Array%20Sum/README_EN.md) | `Array`,`Dynamic Programming` | Medium | Weekly Contest 425 | +| 3367 | [Maximize Sum of Weights after Edge Removals](/solution/3300-3399/3367.Maximize%20Sum%20of%20Weights%20after%20Edge%20Removals/README_EN.md) | `Tree`,`Depth-First Search`,`Dynamic Programming` | Hard | Weekly Contest 425 | +| 3368 | [First Letter Capitalization](/solution/3300-3399/3368.First%20Letter%20Capitalization/README_EN.md) | `Database` | Hard | 🔒 | +| 3369 | [Design an Array Statistics Tracker](/solution/3300-3399/3369.Design%20an%20Array%20Statistics%20Tracker/README_EN.md) | `Queue`,`Hash Table`,`Binary Search` | Hard | 🔒 | +| 3370 | [Smallest Number With All Set Bits](/solution/3300-3399/3370.Smallest%20Number%20With%20All%20Set%20Bits/README_EN.md) | `Bit Manipulation`,`Math` | Easy | Weekly Contest 426 | +| 3371 | [Identify the Largest Outlier in an Array](/solution/3300-3399/3371.Identify%20the%20Largest%20Outlier%20in%20an%20Array/README_EN.md) | `Array`,`Hash Table`,`Counting`,`Enumeration` | Medium | Weekly Contest 426 | +| 3372 | [Maximize the Number of Target Nodes After Connecting Trees I](/solution/3300-3399/3372.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20I/README_EN.md) | `Tree`,`Depth-First Search`,`Breadth-First Search` | Medium | Weekly Contest 426 | +| 3373 | [Maximize the Number of Target Nodes After Connecting Trees II](/solution/3300-3399/3373.Maximize%20the%20Number%20of%20Target%20Nodes%20After%20Connecting%20Trees%20II/README_EN.md) | `Tree`,`Depth-First Search`,`Breadth-First Search` | Hard | Weekly Contest 426 | +| 3374 | [First Letter Capitalization II](/solution/3300-3399/3374.First%20Letter%20Capitalization%20II/README_EN.md) | `Database` | Hard | | ## Copyright