diff --git a/solution/3200-3299/3262.Find Overlapping Shifts/README.md b/solution/3200-3299/3262.Find Overlapping Shifts/README.md index d25d83995a4be..76a31ed07041c 100644 --- a/solution/3200-3299/3262.Find Overlapping Shifts/README.md +++ b/solution/3200-3299/3262.Find Overlapping Shifts/README.md @@ -8,7 +8,7 @@ tags: -# [3262. Find Overlapping Shifts 🔒](https://leetcode.cn/problems/find-overlapping-shifts) +# [3262. 查找重叠的班次 🔒](https://leetcode.cn/problems/find-overlapping-shifts) [English Version](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README_EN.md) @@ -16,7 +16,7 @@ tags: -

Table: EmployeeShifts

+

表:EmployeeShifts

 +------------------+---------+
@@ -26,23 +26,24 @@ tags:
 | start_time       | time    |
 | end_time         | time    |
 +------------------+---------+
-(employee_id, start_time) is the unique key for this table.
-This table contains information about the shifts worked by employees, including the start and end times on a specific date.
+(employee_id, start_time) 是此表的唯一主键。
+这张表包含员工的排班工作,包括特定日期的开始和结束时间。
 
-

Write a solution to count the number of overlapping shifts for each employee. Two shifts are considered overlapping if one shift’s end_time is later than another shift’s start_time.

+

编写一个解决方案来为每个员工计算 重叠排班 的数量。如果一个排班的 end_time 比另一个排班的 start_time 更晚 则认为两个排班重叠。

-

Return the result table ordered by employee_id in ascending order.

+

返回结果表以 employee_id 升序 排序。

-

The query result format is in the following example.

+

查询结果格式如下所示。

 

-

Example:

+ +

示例:

-

Input:

+

输入:

-

EmployeeShifts table:

+

EmployeeShifts 表:

 +-------------+------------+----------+
@@ -61,7 +62,7 @@ This table contains information about the shifts worked by employees, including
 +-------------+------------+----------+
 
-

Output:

+

输出:

 +-------------+--------------------+
@@ -73,38 +74,38 @@ This table contains information about the shifts worked by employees, including
 +-------------+--------------------+
 
-

Explanation:

+

解释:

-

The output shows the employee_id and the count of overlapping shifts for each employee who has at least one overlapping shift, ordered by employee_id in ascending order.

+

输出展示了 employee_id 和至少有一个重叠排班的员工的重叠排班的数量,以 employee_id 升序排序。

@@ -117,13 +118,12 @@ This table contains information about the shifts worked by employees, including 我们首先使用自连接,将 `EmployeeShifts` 表连接自身。通过连接条件,确保只比较同一个员工的班次,并且检查班次之间是否存在重叠。 -1. `t1.start_time < t2.end_time`:确保第一个班次的开始时间早于第二个班次的结束时间。 +1. `t1.start_time < t1.start_time`:确保第一个班次的开始时间早于第二个班次的结束时间。 1. `t1.end_time > t2.start_time`:确保第一个班次的结束时间晚于第二个班次的开始时间。 -1. `t1.start_time != t2.start_time`:避免班次与自身比较。 -接下来,我们对数据按照 `employee_id` 进行分组,统计每个员工的重叠班次数量。这里我们将重叠班次数量除以 2,因为我们在自连接时,每个重叠的班次都会被计算两次。 +接下来,我们对数据按照 `employee_id` 进行分组,统计每个员工的重叠班次数量。 -最后,我们筛选出重叠班次数量大于 0 的员工,并按照 `employee_id` 进行升序排序。 +最后,我们筛选出重叠班次数量大于 $0$ 的员工,并按照 `employee_id` 进行升序排序。 @@ -132,14 +132,13 @@ This table contains information about the shifts worked by employees, including ```sql SELECT t1.employee_id, - COUNT(*) / 2 AS overlapping_shifts + COUNT(*) AS overlapping_shifts FROM EmployeeShifts t1 JOIN EmployeeShifts t2 ON t1.employee_id = t2.employee_id - AND t1.start_time < t2.end_time + AND t1.start_time < t2.start_time AND t1.end_time > t2.start_time - AND t1.start_time != t2.start_time GROUP BY 1 HAVING overlapping_shifts > 0 ORDER BY 1; @@ -152,23 +151,20 @@ import pandas as pd def find_overlapping_shifts(employee_shifts: pd.DataFrame) -> pd.DataFrame: - merged = employee_shifts.merge( - employee_shifts, on="employee_id", suffixes=("_1", "_2") + merged_shifts = employee_shifts.merge( + employee_shifts, on="employee_id", suffixes=("_t1", "_t2") ) - overlap = merged[ - (merged["start_time_1"] < merged["end_time_2"]) - & (merged["end_time_1"] > merged["start_time_2"]) - & (merged["start_time_1"] != merged["start_time_2"]) + overlapping_shifts = merged_shifts[ + (merged_shifts["start_time_t1"] < merged_shifts["start_time_t2"]) + & (merged_shifts["end_time_t1"] > merged_shifts["start_time_t2"]) ] - overlap_counts = ( - overlap.groupby("employee_id").size().reset_index(name="overlapping_shifts") - ) - overlap_counts["overlapping_shifts"] = overlap_counts["overlapping_shifts"] // 2 result = ( - overlap_counts[overlap_counts["overlapping_shifts"] > 0] - .sort_values("employee_id") - .reset_index(drop=True) + overlapping_shifts.groupby("employee_id") + .size() + .reset_index(name="overlapping_shifts") ) + result = result[result["overlapping_shifts"] > 0] + result = result.sort_values("employee_id").reset_index(drop=True) return result ``` diff --git a/solution/3200-3299/3262.Find Overlapping Shifts/README_EN.md b/solution/3200-3299/3262.Find Overlapping Shifts/README_EN.md index 8ea50dd6938a4..0882d8f8301a1 100644 --- a/solution/3200-3299/3262.Find Overlapping Shifts/README_EN.md +++ b/solution/3200-3299/3262.Find Overlapping Shifts/README_EN.md @@ -113,17 +113,16 @@ This table contains information about the shifts worked by employees, including -### Solution 1: Self-Join + Group Count +### Solution 1: Self-Join + Group Counting -We start by using a self-join to join the `EmployeeShifts` table with itself. The join condition ensures that only shifts of the same employee are compared, and checks if there is any overlap between the shifts. +We first use a self-join to connect the `EmployeeShifts` table to itself. The join condition ensures that we only compare shifts belonging to the same employee and check if there is any overlap between shifts. -1. `t1.start_time < t2.end_time`: Ensures that the start time of the first shift is earlier than the end time of the second shift. +1. `t1.start_time < t2.start_time`: Ensures that the start time of the first shift is earlier than the start time of the second shift. 2. `t1.end_time > t2.start_time`: Ensures that the end time of the first shift is later than the start time of the second shift. -3. `t1.start_time != t2.start_time`: Avoids comparing a shift with itself. -Next, we group the data by `employee_id` and count the number of overlapping shifts for each employee. We divide the count by 2 because each overlap is counted twice in the self-join. +Next, we group the data by `employee_id` and count the number of overlapping shifts for each employee. -Finally, we filter out employees with an overlapping shift count greater than 0 and sort the results in ascending order by `employee_id`. +Finally, we filter out employees with overlapping shift counts greater than $0$ and sort the results in ascending order by `employee_id`. @@ -132,14 +131,13 @@ Finally, we filter out employees with an overlapping shift count greater than 0 ```sql SELECT t1.employee_id, - COUNT(*) / 2 AS overlapping_shifts + COUNT(*) AS overlapping_shifts FROM EmployeeShifts t1 JOIN EmployeeShifts t2 ON t1.employee_id = t2.employee_id - AND t1.start_time < t2.end_time + AND t1.start_time < t2.start_time AND t1.end_time > t2.start_time - AND t1.start_time != t2.start_time GROUP BY 1 HAVING overlapping_shifts > 0 ORDER BY 1; @@ -152,23 +150,20 @@ import pandas as pd def find_overlapping_shifts(employee_shifts: pd.DataFrame) -> pd.DataFrame: - merged = employee_shifts.merge( - employee_shifts, on="employee_id", suffixes=("_1", "_2") + merged_shifts = employee_shifts.merge( + employee_shifts, on="employee_id", suffixes=("_t1", "_t2") ) - overlap = merged[ - (merged["start_time_1"] < merged["end_time_2"]) - & (merged["end_time_1"] > merged["start_time_2"]) - & (merged["start_time_1"] != merged["start_time_2"]) + overlapping_shifts = merged_shifts[ + (merged_shifts["start_time_t1"] < merged_shifts["start_time_t2"]) + & (merged_shifts["end_time_t1"] > merged_shifts["start_time_t2"]) ] - overlap_counts = ( - overlap.groupby("employee_id").size().reset_index(name="overlapping_shifts") - ) - overlap_counts["overlapping_shifts"] = overlap_counts["overlapping_shifts"] // 2 result = ( - overlap_counts[overlap_counts["overlapping_shifts"] > 0] - .sort_values("employee_id") - .reset_index(drop=True) + overlapping_shifts.groupby("employee_id") + .size() + .reset_index(name="overlapping_shifts") ) + result = result[result["overlapping_shifts"] > 0] + result = result.sort_values("employee_id").reset_index(drop=True) return result ``` diff --git a/solution/3200-3299/3262.Find Overlapping Shifts/Solution.py b/solution/3200-3299/3262.Find Overlapping Shifts/Solution.py index b670a8ad76853..374b21f695199 100644 --- a/solution/3200-3299/3262.Find Overlapping Shifts/Solution.py +++ b/solution/3200-3299/3262.Find Overlapping Shifts/Solution.py @@ -2,21 +2,18 @@ def find_overlapping_shifts(employee_shifts: pd.DataFrame) -> pd.DataFrame: - merged = employee_shifts.merge( - employee_shifts, on="employee_id", suffixes=("_1", "_2") + merged_shifts = employee_shifts.merge( + employee_shifts, on="employee_id", suffixes=("_t1", "_t2") ) - overlap = merged[ - (merged["start_time_1"] < merged["end_time_2"]) - & (merged["end_time_1"] > merged["start_time_2"]) - & (merged["start_time_1"] != merged["start_time_2"]) + overlapping_shifts = merged_shifts[ + (merged_shifts["start_time_t1"] < merged_shifts["start_time_t2"]) + & (merged_shifts["end_time_t1"] > merged_shifts["start_time_t2"]) ] - overlap_counts = ( - overlap.groupby("employee_id").size().reset_index(name="overlapping_shifts") - ) - overlap_counts["overlapping_shifts"] = overlap_counts["overlapping_shifts"] // 2 result = ( - overlap_counts[overlap_counts["overlapping_shifts"] > 0] - .sort_values("employee_id") - .reset_index(drop=True) + overlapping_shifts.groupby("employee_id") + .size() + .reset_index(name="overlapping_shifts") ) + result = result[result["overlapping_shifts"] > 0] + result = result.sort_values("employee_id").reset_index(drop=True) return result diff --git a/solution/3200-3299/3262.Find Overlapping Shifts/Solution.sql b/solution/3200-3299/3262.Find Overlapping Shifts/Solution.sql index fa5d404105bd7..ada0f2f905850 100644 --- a/solution/3200-3299/3262.Find Overlapping Shifts/Solution.sql +++ b/solution/3200-3299/3262.Find Overlapping Shifts/Solution.sql @@ -1,13 +1,12 @@ SELECT t1.employee_id, - COUNT(*) / 2 AS overlapping_shifts + COUNT(*) AS overlapping_shifts FROM EmployeeShifts t1 JOIN EmployeeShifts t2 ON t1.employee_id = t2.employee_id - AND t1.start_time < t2.end_time + AND t1.start_time < t2.start_time AND t1.end_time > t2.start_time - AND t1.start_time != t2.start_time GROUP BY 1 HAVING overlapping_shifts > 0 ORDER BY 1; diff --git a/solution/3200-3299/3263.Convert Doubly Linked List to Array I/README.md b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/README.md new file mode 100644 index 0000000000000..4970e3713dd40 --- /dev/null +++ b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/README.md @@ -0,0 +1,192 @@ +--- +comments: true +difficulty: 简单 +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3263.Convert%20Doubly%20Linked%20List%20to%20Array%20I/README.md +--- + + + +# [3263. Convert Doubly Linked List to Array I 🔒](https://leetcode.cn/problems/convert-doubly-linked-list-to-array-i) + +[English Version](/solution/3200-3299/3263.Convert%20Doubly%20Linked%20List%20to%20Array%20I/README_EN.md) + +## 题目描述 + + + +

You are given the head of a doubly linked list, which contains nodes that have a next pointer and a previous pointer.

+ +

Return an integer array which contains the elements of the linked list in order.

+ +

 

+

Example 1:

+ +
+

Input: head = [1,2,3,4,3,2,1]

+ +

Output: [1,2,3,4,3,2,1]

+
+ +

Example 2:

+ +
+

Input: head = [2,2,2,2,2]

+ +

Output: [2,2,2,2,2]

+
+ +

Example 3:

+ +
+

Input: head = [3,2,3,2,3,2]

+ +

Output: [3,2,3,2,3,2]

+
+ +

 

+

Constraints:

+ + + + + +## 解法 + + + +### 方法一:直接遍历 + +我们可以直接遍历链表,将节点的值依次添加到答案数组 $\textit{ans}$ 中。 + +遍历结束后,返回答案数组 $\textit{ans}$ 即可。 + +时间复杂度 $O(n)$,其中 $n$ 为链表的长度。忽略答案数组的空间消耗,空间复杂度 $O(1)$。 + + + +#### Python3 + +```python +""" +# Definition for a Node. +class Node: + def __init__(self, val, prev=None, next=None): + self.val = val + self.prev = prev + self.next = next +""" + + +class Solution: + def toArray(self, root: "Optional[Node]") -> List[int]: + ans = [] + while root: + ans.append(root.val) + root = root.next + return ans +``` + +#### Java + +```java +/* +// Definition for a Node. +class Node { + public int val; + public Node prev; + public Node next; +}; +*/ + +class Solution { + public int[] toArray(Node head) { + List ans = new ArrayList<>(); + for (; head != null; head = head.next) { + ans.add(head.val); + } + return ans.stream().mapToInt(i -> i).toArray(); + } +} +``` + +#### C++ + +```cpp +/** + * Definition for doubly-linked list. + * class Node { + * int val; + * Node* prev; + * Node* next; + * Node() : val(0), next(nullptr), prev(nullptr) {} + * Node(int x) : val(x), next(nullptr), prev(nullptr) {} + * Node(int x, Node *prev, Node *next) : val(x), next(next), prev(prev) {} + * }; + */ +class Solution { +public: + vector toArray(Node* head) { + vector ans; + for (; head; head = head->next) { + ans.push_back(head->val); + } + return ans; + } +}; +``` + +#### Go + +```go +/** + * Definition for a Node. + * type Node struct { + * Val int + * Next *Node + * Prev *Node + * } + */ + +func toArray(head *Node) (ans []int) { + for ; head != nil; head = head.Next { + ans = append(ans, head.Val) + } + return +} +``` + +#### TypeScript + +```ts +/** + * Definition for _Node. + * class _Node { + * val: number + * prev: _Node | null + * next: _Node | null + * + * constructor(val?: number, prev? : _Node, next? : _Node) { + * this.val = (val===undefined ? 0 : val); + * this.prev = (prev===undefined ? null : prev); + * this.next = (next===undefined ? null : next); + * } + * } + */ + +function toArray(head: _Node | null): number[] { + const ans: number[] = []; + for (; head; head = head.next) { + ans.push(head.val); + } + return ans; +} +``` + + + + + + diff --git a/solution/3200-3299/3263.Convert Doubly Linked List to Array I/README_EN.md b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/README_EN.md new file mode 100644 index 0000000000000..88319b5e7b123 --- /dev/null +++ b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/README_EN.md @@ -0,0 +1,192 @@ +--- +comments: true +difficulty: Easy +edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3263.Convert%20Doubly%20Linked%20List%20to%20Array%20I/README_EN.md +--- + + + +# [3263. Convert Doubly Linked List to Array I 🔒](https://leetcode.com/problems/convert-doubly-linked-list-to-array-i) + +[中文文档](/solution/3200-3299/3263.Convert%20Doubly%20Linked%20List%20to%20Array%20I/README.md) + +## Description + + + +

You are given the head of a doubly linked list, which contains nodes that have a next pointer and a previous pointer.

+ +

Return an integer array which contains the elements of the linked list in order.

+ +

 

+

Example 1:

+ +
+

Input: head = [1,2,3,4,3,2,1]

+ +

Output: [1,2,3,4,3,2,1]

+
+ +

Example 2:

+ +
+

Input: head = [2,2,2,2,2]

+ +

Output: [2,2,2,2,2]

+
+ +

Example 3:

+ +
+

Input: head = [3,2,3,2,3,2]

+ +

Output: [3,2,3,2,3,2]

+
+ +

 

+

Constraints:

+ +
    +
  • The number of nodes in the given list is in the range [1, 50].
  • +
  • 1 <= Node.val <= 50
  • +
+ + + +## Solutions + + + +### Solution 1: Direct Traversal + +We can directly traverse the linked list, adding the values of the nodes to the answer array $\textit{ans}$ one by one. + +After the traversal is complete, return the answer array $\textit{ans}$. + +The time complexity is $O(n)$, where $n$ is the length of the linked list. Ignoring the space consumption of the answer array, the space complexity is $O(1)$. + + + +#### Python3 + +```python +""" +# Definition for a Node. +class Node: + def __init__(self, val, prev=None, next=None): + self.val = val + self.prev = prev + self.next = next +""" + + +class Solution: + def toArray(self, root: "Optional[Node]") -> List[int]: + ans = [] + while root: + ans.append(root.val) + root = root.next + return ans +``` + +#### Java + +```java +/* +// Definition for a Node. +class Node { + public int val; + public Node prev; + public Node next; +}; +*/ + +class Solution { + public int[] toArray(Node head) { + List ans = new ArrayList<>(); + for (; head != null; head = head.next) { + ans.add(head.val); + } + return ans.stream().mapToInt(i -> i).toArray(); + } +} +``` + +#### C++ + +```cpp +/** + * Definition for doubly-linked list. + * class Node { + * int val; + * Node* prev; + * Node* next; + * Node() : val(0), next(nullptr), prev(nullptr) {} + * Node(int x) : val(x), next(nullptr), prev(nullptr) {} + * Node(int x, Node *prev, Node *next) : val(x), next(next), prev(prev) {} + * }; + */ +class Solution { +public: + vector toArray(Node* head) { + vector ans; + for (; head; head = head->next) { + ans.push_back(head->val); + } + return ans; + } +}; +``` + +#### Go + +```go +/** + * Definition for a Node. + * type Node struct { + * Val int + * Next *Node + * Prev *Node + * } + */ + +func toArray(head *Node) (ans []int) { + for ; head != nil; head = head.Next { + ans = append(ans, head.Val) + } + return +} +``` + +#### TypeScript + +```ts +/** + * Definition for _Node. + * class _Node { + * val: number + * prev: _Node | null + * next: _Node | null + * + * constructor(val?: number, prev? : _Node, next? : _Node) { + * this.val = (val===undefined ? 0 : val); + * this.prev = (prev===undefined ? null : prev); + * this.next = (next===undefined ? null : next); + * } + * } + */ + +function toArray(head: _Node | null): number[] { + const ans: number[] = []; + for (; head; head = head.next) { + ans.push(head.val); + } + return ans; +} +``` + + + + + + diff --git a/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.cpp b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.cpp new file mode 100644 index 0000000000000..c02659a356adf --- /dev/null +++ b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.cpp @@ -0,0 +1,21 @@ +/** + * Definition for doubly-linked list. + * class Node { + * int val; + * Node* prev; + * Node* next; + * Node() : val(0), next(nullptr), prev(nullptr) {} + * Node(int x) : val(x), next(nullptr), prev(nullptr) {} + * Node(int x, Node *prev, Node *next) : val(x), next(next), prev(prev) {} + * }; + */ +class Solution { +public: + vector toArray(Node* head) { + vector ans; + for (; head; head = head->next) { + ans.push_back(head->val); + } + return ans; + } +}; diff --git a/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.go b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.go new file mode 100644 index 0000000000000..f7bc140b1657e --- /dev/null +++ b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.go @@ -0,0 +1,15 @@ +/** + * Definition for a Node. + * type Node struct { + * Val int + * Next *Node + * Prev *Node + * } + */ + +func toArray(head *Node) (ans []int) { + for ; head != nil; head = head.Next { + ans = append(ans, head.Val) + } + return +} diff --git a/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.java b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.java new file mode 100644 index 0000000000000..fef1a77a1e0bf --- /dev/null +++ b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.java @@ -0,0 +1,18 @@ +/* +// Definition for a Node. +class Node { + public int val; + public Node prev; + public Node next; +}; +*/ + +class Solution { + public int[] toArray(Node head) { + List ans = new ArrayList<>(); + for (; head != null; head = head.next) { + ans.add(head.val); + } + return ans.stream().mapToInt(i -> i).toArray(); + } +} diff --git a/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.py b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.py new file mode 100644 index 0000000000000..f5498238f0900 --- /dev/null +++ b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.py @@ -0,0 +1,17 @@ +""" +# Definition for a Node. +class Node: + def __init__(self, val, prev=None, next=None): + self.val = val + self.prev = prev + self.next = next +""" + + +class Solution: + def toArray(self, root: "Optional[Node]") -> List[int]: + ans = [] + while root: + ans.append(root.val) + root = root.next + return ans diff --git a/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.ts b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.ts new file mode 100644 index 0000000000000..af9e2027bfeb1 --- /dev/null +++ b/solution/3200-3299/3263.Convert Doubly Linked List to Array I/Solution.ts @@ -0,0 +1,22 @@ +/** + * Definition for _Node. + * class _Node { + * val: number + * prev: _Node | null + * next: _Node | null + * + * constructor(val?: number, prev? : _Node, next? : _Node) { + * this.val = (val===undefined ? 0 : val); + * this.prev = (prev===undefined ? null : prev); + * this.next = (next===undefined ? null : next); + * } + * } + */ + +function toArray(head: _Node | null): number[] { + const ans: number[] = []; + for (; head; head = head.next) { + ans.push(head.val); + } + return ans; +} diff --git a/solution/CONTEST_README.md b/solution/CONTEST_README.md index 7d35115f978c7..ca8a7957c7b8c 100644 --- a/solution/CONTEST_README.md +++ b/solution/CONTEST_README.md @@ -2730,6 +2730,7 @@ comments: true #### 第 154 场周赛(2019-09-15 10:30, 90 分钟) 参赛人数 1299 +- [1189. “气球” 的最大数量](/solution/1100-1199/1189.Maximum%20Number%20of%20Balloons/README.md) - [1190. 反转每对括号间的子串](/solution/1100-1199/1190.Reverse%20Substrings%20Between%20Each%20Pair%20of%20Parentheses/README.md) - [1191. K 次串联后最大子数组之和](/solution/1100-1199/1191.K-Concatenation%20Maximum%20Sum/README.md) - [1192. 查找集群内的关键连接](/solution/1100-1199/1192.Critical%20Connections%20in%20a%20Network/README.md) diff --git a/solution/CONTEST_README_EN.md b/solution/CONTEST_README_EN.md index 13ae499d2057a..4d933a032a96a 100644 --- a/solution/CONTEST_README_EN.md +++ b/solution/CONTEST_README_EN.md @@ -2733,6 +2733,7 @@ If you want to estimate your score changes after the contest ends, you can visit #### Weekly Contest 154 +- [1189. Maximum Number of Balloons](/solution/1100-1199/1189.Maximum%20Number%20of%20Balloons/README_EN.md) - [1190. Reverse Substrings Between Each Pair of Parentheses](/solution/1100-1199/1190.Reverse%20Substrings%20Between%20Each%20Pair%20of%20Parentheses/README_EN.md) - [1191. K-Concatenation Maximum Sum](/solution/1100-1199/1191.K-Concatenation%20Maximum%20Sum/README_EN.md) - [1192. Critical Connections in a Network](/solution/1100-1199/1192.Critical%20Connections%20in%20a%20Network/README_EN.md) diff --git a/solution/DATABASE_README.md b/solution/DATABASE_README.md index f2bdefbd30147..24636f820ef0a 100644 --- a/solution/DATABASE_README.md +++ b/solution/DATABASE_README.md @@ -292,7 +292,7 @@ | 3236 | [首席执行官下属层级](/solution/3200-3299/3236.CEO%20Subordinate%20Hierarchy/README.md) | `数据库` | 困难 | 🔒 | | 3246 | [英超积分榜排名](/solution/3200-3299/3246.Premier%20League%20Table%20Ranking/README.md) | `数据库` | 简单 | 🔒 | | 3252 | [英超积分榜排名 II](/solution/3200-3299/3252.Premier%20League%20Table%20Ranking%20II/README.md) | `数据库` | 中等 | 🔒 | -| 3262 | [Find Overlapping Shifts](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README.md) | | 中等 | 🔒 | +| 3262 | [查找重叠的班次](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README.md) | | 中等 | 🔒 | ## 版权 diff --git a/solution/README.md b/solution/README.md index d98f0ecb11f7b..3739034b935a7 100644 --- a/solution/README.md +++ b/solution/README.md @@ -1199,6 +1199,7 @@ | 1186 | [删除一次得到子数组最大和](/solution/1100-1199/1186.Maximum%20Subarray%20Sum%20with%20One%20Deletion/README.md) | `数组`,`动态规划` | 中等 | 第 153 场周赛 | | 1187 | [使数组严格递增](/solution/1100-1199/1187.Make%20Array%20Strictly%20Increasing/README.md) | `数组`,`二分查找`,`动态规划`,`排序` | 困难 | 第 153 场周赛 | | 1188 | [设计有限阻塞队列](/solution/1100-1199/1188.Design%20Bounded%20Blocking%20Queue/README.md) | `多线程` | 中等 | 🔒 | +| 1189 | [“气球” 的最大数量](/solution/1100-1199/1189.Maximum%20Number%20of%20Balloons/README.md) | `哈希表`,`字符串`,`计数` | 简单 | 第 154 场周赛 | | 1190 | [反转每对括号间的子串](/solution/1100-1199/1190.Reverse%20Substrings%20Between%20Each%20Pair%20of%20Parentheses/README.md) | `栈`,`字符串` | 中等 | 第 154 场周赛 | | 1191 | [K 次串联后最大子数组之和](/solution/1100-1199/1191.K-Concatenation%20Maximum%20Sum/README.md) | `数组`,`动态规划` | 中等 | 第 154 场周赛 | | 1192 | [查找集群内的关键连接](/solution/1100-1199/1192.Critical%20Connections%20in%20a%20Network/README.md) | `深度优先搜索`,`图`,`双连通分量` | 困难 | 第 154 场周赛 | @@ -3271,7 +3272,8 @@ | 3259 | [超级饮料的最大强化能量](/solution/3200-3299/3259.Maximum%20Energy%20Boost%20From%20Two%20Drinks/README.md) | `数组`,`动态规划` | 中等 | 第 411 场周赛 | | 3260 | [找出最大的 N 位 K 回文数](/solution/3200-3299/3260.Find%20the%20Largest%20Palindrome%20Divisible%20by%20K/README.md) | `贪心`,`数学`,`字符串`,`动态规划`,`数论` | 困难 | 第 411 场周赛 | | 3261 | [统计满足 K 约束的子字符串数量 II](/solution/3200-3299/3261.Count%20Substrings%20That%20Satisfy%20K-Constraint%20II/README.md) | `数组`,`字符串`,`二分查找`,`前缀和`,`滑动窗口` | 困难 | 第 411 场周赛 | -| 3262 | [Find Overlapping Shifts](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README.md) | | 中等 | 🔒 | +| 3262 | [查找重叠的班次](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README.md) | | 中等 | 🔒 | +| 3263 | [Convert Doubly Linked List to Array I](/solution/3200-3299/3263.Convert%20Doubly%20Linked%20List%20to%20Array%20I/README.md) | | 简单 | 🔒 | ## 版权 diff --git a/solution/README_EN.md b/solution/README_EN.md index 4ff2f3aefd7c6..44acf5de94cd0 100644 --- a/solution/README_EN.md +++ b/solution/README_EN.md @@ -1197,6 +1197,7 @@ Press Control + F(or Command + F on | 1186 | [Maximum Subarray Sum with One Deletion](/solution/1100-1199/1186.Maximum%20Subarray%20Sum%20with%20One%20Deletion/README_EN.md) | `Array`,`Dynamic Programming` | Medium | Weekly Contest 153 | | 1187 | [Make Array Strictly Increasing](/solution/1100-1199/1187.Make%20Array%20Strictly%20Increasing/README_EN.md) | `Array`,`Binary Search`,`Dynamic Programming`,`Sorting` | Hard | Weekly Contest 153 | | 1188 | [Design Bounded Blocking Queue](/solution/1100-1199/1188.Design%20Bounded%20Blocking%20Queue/README_EN.md) | `Concurrency` | Medium | 🔒 | +| 1189 | [Maximum Number of Balloons](/solution/1100-1199/1189.Maximum%20Number%20of%20Balloons/README_EN.md) | `Hash Table`,`String`,`Counting` | Easy | Weekly Contest 154 | | 1190 | [Reverse Substrings Between Each Pair of Parentheses](/solution/1100-1199/1190.Reverse%20Substrings%20Between%20Each%20Pair%20of%20Parentheses/README_EN.md) | `Stack`,`String` | Medium | Weekly Contest 154 | | 1191 | [K-Concatenation Maximum Sum](/solution/1100-1199/1191.K-Concatenation%20Maximum%20Sum/README_EN.md) | `Array`,`Dynamic Programming` | Medium | Weekly Contest 154 | | 1192 | [Critical Connections in a Network](/solution/1100-1199/1192.Critical%20Connections%20in%20a%20Network/README_EN.md) | `Depth-First Search`,`Graph`,`Biconnected Component` | Hard | Weekly Contest 154 | @@ -3270,6 +3271,7 @@ Press Control + F(or Command + F on | 3260 | [Find the Largest Palindrome Divisible by K](/solution/3200-3299/3260.Find%20the%20Largest%20Palindrome%20Divisible%20by%20K/README_EN.md) | `Greedy`,`Math`,`String`,`Dynamic Programming`,`Number Theory` | Hard | Weekly Contest 411 | | 3261 | [Count Substrings That Satisfy K-Constraint II](/solution/3200-3299/3261.Count%20Substrings%20That%20Satisfy%20K-Constraint%20II/README_EN.md) | `Array`,`String`,`Binary Search`,`Prefix Sum`,`Sliding Window` | Hard | Weekly Contest 411 | | 3262 | [Find Overlapping Shifts](/solution/3200-3299/3262.Find%20Overlapping%20Shifts/README_EN.md) | | Medium | 🔒 | +| 3263 | [Convert Doubly Linked List to Array I](/solution/3200-3299/3263.Convert%20Doubly%20Linked%20List%20to%20Array%20I/README_EN.md) | | Easy | 🔒 | ## Copyright