diff --git a/solution/3500-3599/3549.Multiply Two Polynomials/README.md b/solution/3500-3599/3549.Multiply Two Polynomials/README.md index 63befadf152ff..1417fea469f74 100644 --- a/solution/3500-3599/3549.Multiply Two Polynomials/README.md +++ b/solution/3500-3599/3549.Multiply Two Polynomials/README.md @@ -21,7 +21,7 @@ tags:
设 A(x)
和 B(x)
分别是 poly1
和 poly2
表示的多项式。
返回一个整数数组 result
表示乘积多项式 R(x) = A(x) * B(x)
的系数,其中 result[i]
表示 R(x)
中 xi
的系数。
返回一个长度为 (poly1.length + poly2.length - 1)
的整数数组 result
表示乘积多项式 R(x) = A(x) * B(x)
的系数,其中 result[i]
表示 R(x)
中 xi
的系数。
diff --git a/solution/3500-3599/3549.Multiply Two Polynomials/README_EN.md b/solution/3500-3599/3549.Multiply Two Polynomials/README_EN.md index 1aa73537918af..bdbdecb600922 100644 --- a/solution/3500-3599/3549.Multiply Two Polynomials/README_EN.md +++ b/solution/3500-3599/3549.Multiply Two Polynomials/README_EN.md @@ -21,7 +21,7 @@ tags:
Let A(x)
and B(x)
be the polynomials represented by poly1
and poly2
, respectively.
Return an integer array result
representing the coefficients of the product polynomial R(x) = A(x) * B(x)
, where result[i]
denotes the coefficient of xi
in R(x)
.
Return an integer array result
of length (poly1.length + poly2.length - 1)
representing the coefficients of the product polynomial R(x) = A(x) * B(x)
, where result[i]
denotes the coefficient of xi
in R(x)
.
Example 1:
diff --git a/solution/3500-3599/3555.Smallest Subarray to Sort in Every Sliding Window/README.md b/solution/3500-3599/3555.Smallest Subarray to Sort in Every Sliding Window/README.md index 82e631eef37aa..4071fe4919a20 100644 --- a/solution/3500-3599/3555.Smallest Subarray to Sort in Every Sliding Window/README.md +++ b/solution/3500-3599/3555.Smallest Subarray to Sort in Every Sliding Window/README.md @@ -2,6 +2,13 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3555.Smallest%20Subarray%20to%20Sort%20in%20Every%20Sliding%20Window/README.md +tags: + - 栈 + - 贪心 + - 数组 + - 双指针 + - 排序 + - 单调栈 --- diff --git a/solution/3500-3599/3555.Smallest Subarray to Sort in Every Sliding Window/README_EN.md b/solution/3500-3599/3555.Smallest Subarray to Sort in Every Sliding Window/README_EN.md index 0573791ebb1e9..446fb651be68b 100644 --- a/solution/3500-3599/3555.Smallest Subarray to Sort in Every Sliding Window/README_EN.md +++ b/solution/3500-3599/3555.Smallest Subarray to Sort in Every Sliding Window/README_EN.md @@ -2,6 +2,13 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3555.Smallest%20Subarray%20to%20Sort%20in%20Every%20Sliding%20Window/README_EN.md +tags: + - Stack + - Greedy + - Array + - Two Pointers + - Sorting + - Monotonic Stack --- diff --git a/solution/3500-3599/3556.Sum of Largest Prime Substrings/README.md b/solution/3500-3599/3556.Sum of Largest Prime Substrings/README.md index 379cd7f524ca8..b649667ce62b2 100644 --- a/solution/3500-3599/3556.Sum of Largest Prime Substrings/README.md +++ b/solution/3500-3599/3556.Sum of Largest Prime Substrings/README.md @@ -2,6 +2,12 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3556.Sum%20of%20Largest%20Prime%20Substrings/README.md +tags: + - 哈希表 + - 数学 + - 字符串 + - 数论 + - 排序 --- diff --git a/solution/3500-3599/3556.Sum of Largest Prime Substrings/README_EN.md b/solution/3500-3599/3556.Sum of Largest Prime Substrings/README_EN.md index 4525afd8ef0b5..ee28b3cff5b6e 100644 --- a/solution/3500-3599/3556.Sum of Largest Prime Substrings/README_EN.md +++ b/solution/3500-3599/3556.Sum of Largest Prime Substrings/README_EN.md @@ -2,6 +2,12 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3556.Sum%20of%20Largest%20Prime%20Substrings/README_EN.md +tags: + - Hash Table + - Math + - String + - Number Theory + - Sorting --- diff --git a/solution/3500-3599/3557.Find Maximum Number of Non Intersecting Substrings/README.md b/solution/3500-3599/3557.Find Maximum Number of Non Intersecting Substrings/README.md index a08d47b9fdafd..19cac123092c8 100644 --- a/solution/3500-3599/3557.Find Maximum Number of Non Intersecting Substrings/README.md +++ b/solution/3500-3599/3557.Find Maximum Number of Non Intersecting Substrings/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3557.Find%20Maximum%20Number%20of%20Non%20Intersecting%20Substrings/README.md +tags: + - 贪心 + - 哈希表 + - 字符串 + - 动态规划 --- diff --git a/solution/3500-3599/3557.Find Maximum Number of Non Intersecting Substrings/README_EN.md b/solution/3500-3599/3557.Find Maximum Number of Non Intersecting Substrings/README_EN.md index c3c5e57518031..df941c3ab6d70 100644 --- a/solution/3500-3599/3557.Find Maximum Number of Non Intersecting Substrings/README_EN.md +++ b/solution/3500-3599/3557.Find Maximum Number of Non Intersecting Substrings/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3557.Find%20Maximum%20Number%20of%20Non%20Intersecting%20Substrings/README_EN.md +tags: + - Greedy + - Hash Table + - String + - Dynamic Programming --- diff --git a/solution/3500-3599/3558.Number of Ways to Assign Edge Weights I/README.md b/solution/3500-3599/3558.Number of Ways to Assign Edge Weights I/README.md index 4fade87561c3b..4139dd239cec7 100644 --- a/solution/3500-3599/3558.Number of Ways to Assign Edge Weights I/README.md +++ b/solution/3500-3599/3558.Number of Ways to Assign Edge Weights I/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3558.Number%20of%20Ways%20to%20Assign%20Edge%20Weights%20I/README.md +tags: + - 树 + - 深度优先搜索 + - 数学 --- diff --git a/solution/3500-3599/3558.Number of Ways to Assign Edge Weights I/README_EN.md b/solution/3500-3599/3558.Number of Ways to Assign Edge Weights I/README_EN.md index 9ec51f93e3f21..a75c0cb066438 100644 --- a/solution/3500-3599/3558.Number of Ways to Assign Edge Weights I/README_EN.md +++ b/solution/3500-3599/3558.Number of Ways to Assign Edge Weights I/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3558.Number%20of%20Ways%20to%20Assign%20Edge%20Weights%20I/README_EN.md +tags: + - Tree + - Depth-First Search + - Math --- diff --git a/solution/3500-3599/3559.Number of Ways to Assign Edge Weights II/README.md b/solution/3500-3599/3559.Number of Ways to Assign Edge Weights II/README.md index 4b12016cf602d..cc538dec3c74d 100644 --- a/solution/3500-3599/3559.Number of Ways to Assign Edge Weights II/README.md +++ b/solution/3500-3599/3559.Number of Ways to Assign Edge Weights II/README.md @@ -2,6 +2,12 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3559.Number%20of%20Ways%20to%20Assign%20Edge%20Weights%20II/README.md +tags: + - 树 + - 深度优先搜索 + - 数组 + - 数学 + - 动态规划 --- diff --git a/solution/3500-3599/3559.Number of Ways to Assign Edge Weights II/README_EN.md b/solution/3500-3599/3559.Number of Ways to Assign Edge Weights II/README_EN.md index 4c07baabb6761..6268dc6858e85 100644 --- a/solution/3500-3599/3559.Number of Ways to Assign Edge Weights II/README_EN.md +++ b/solution/3500-3599/3559.Number of Ways to Assign Edge Weights II/README_EN.md @@ -2,6 +2,12 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3559.Number%20of%20Ways%20to%20Assign%20Edge%20Weights%20II/README_EN.md +tags: + - Tree + - Depth-First Search + - Array + - Math + - Dynamic Programming --- diff --git a/solution/3500-3599/3560.Find Minimum Log Transportation Cost/README.md b/solution/3500-3599/3560.Find Minimum Log Transportation Cost/README.md index a61f873580752..39ea5b2164e9d 100644 --- a/solution/3500-3599/3560.Find Minimum Log Transportation Cost/README.md +++ b/solution/3500-3599/3560.Find Minimum Log Transportation Cost/README.md @@ -2,6 +2,8 @@ comments: true difficulty: 简单 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3560.Find%20Minimum%20Log%20Transportation%20Cost/README.md +tags: + - 数学 --- diff --git a/solution/3500-3599/3560.Find Minimum Log Transportation Cost/README_EN.md b/solution/3500-3599/3560.Find Minimum Log Transportation Cost/README_EN.md index 61e1e379cc4db..4898cdf7ea597 100644 --- a/solution/3500-3599/3560.Find Minimum Log Transportation Cost/README_EN.md +++ b/solution/3500-3599/3560.Find Minimum Log Transportation Cost/README_EN.md @@ -2,6 +2,8 @@ comments: true difficulty: Easy edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3560.Find%20Minimum%20Log%20Transportation%20Cost/README_EN.md +tags: + - Math --- diff --git a/solution/3500-3599/3561.Resulting String After Adjacent Removals/README.md b/solution/3500-3599/3561.Resulting String After Adjacent Removals/README.md index f9c935f73907e..0f2444eba999e 100644 --- a/solution/3500-3599/3561.Resulting String After Adjacent Removals/README.md +++ b/solution/3500-3599/3561.Resulting String After Adjacent Removals/README.md @@ -2,6 +2,10 @@ comments: true difficulty: 中等 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3561.Resulting%20String%20After%20Adjacent%20Removals/README.md +tags: + - 栈 + - 字符串 + - 模拟 --- diff --git a/solution/3500-3599/3561.Resulting String After Adjacent Removals/README_EN.md b/solution/3500-3599/3561.Resulting String After Adjacent Removals/README_EN.md index 1d88885331f2c..607f4865a98d4 100644 --- a/solution/3500-3599/3561.Resulting String After Adjacent Removals/README_EN.md +++ b/solution/3500-3599/3561.Resulting String After Adjacent Removals/README_EN.md @@ -2,6 +2,10 @@ comments: true difficulty: Medium edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3561.Resulting%20String%20After%20Adjacent%20Removals/README_EN.md +tags: + - Stack + - String + - Simulation --- diff --git a/solution/3500-3599/3562.Maximum Profit from Trading Stocks with Discounts/README.md b/solution/3500-3599/3562.Maximum Profit from Trading Stocks with Discounts/README.md index 48c2fc3bb1459..7bb8c966164e8 100644 --- a/solution/3500-3599/3562.Maximum Profit from Trading Stocks with Discounts/README.md +++ b/solution/3500-3599/3562.Maximum Profit from Trading Stocks with Discounts/README.md @@ -2,6 +2,11 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3562.Maximum%20Profit%20from%20Trading%20Stocks%20with%20Discounts/README.md +tags: + - 树 + - 深度优先搜索 + - 数组 + - 动态规划 --- diff --git a/solution/3500-3599/3562.Maximum Profit from Trading Stocks with Discounts/README_EN.md b/solution/3500-3599/3562.Maximum Profit from Trading Stocks with Discounts/README_EN.md index d7f75d857d91f..fb44fc7a68dea 100644 --- a/solution/3500-3599/3562.Maximum Profit from Trading Stocks with Discounts/README_EN.md +++ b/solution/3500-3599/3562.Maximum Profit from Trading Stocks with Discounts/README_EN.md @@ -2,6 +2,11 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3562.Maximum%20Profit%20from%20Trading%20Stocks%20with%20Discounts/README_EN.md +tags: + - Tree + - Depth-First Search + - Array + - Dynamic Programming --- diff --git a/solution/3500-3599/3563.Lexicographically Smallest String After Adjacent Removals/README.md b/solution/3500-3599/3563.Lexicographically Smallest String After Adjacent Removals/README.md index 78d69511fb88a..63a0ebed9af10 100644 --- a/solution/3500-3599/3563.Lexicographically Smallest String After Adjacent Removals/README.md +++ b/solution/3500-3599/3563.Lexicographically Smallest String After Adjacent Removals/README.md @@ -2,6 +2,9 @@ comments: true difficulty: 困难 edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3563.Lexicographically%20Smallest%20String%20After%20Adjacent%20Removals/README.md +tags: + - 字符串 + - 动态规划 --- diff --git a/solution/3500-3599/3563.Lexicographically Smallest String After Adjacent Removals/README_EN.md b/solution/3500-3599/3563.Lexicographically Smallest String After Adjacent Removals/README_EN.md index 66c88c680e50f..9ebf3ac10e5b3 100644 --- a/solution/3500-3599/3563.Lexicographically Smallest String After Adjacent Removals/README_EN.md +++ b/solution/3500-3599/3563.Lexicographically Smallest String After Adjacent Removals/README_EN.md @@ -2,6 +2,9 @@ comments: true difficulty: Hard edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3563.Lexicographically%20Smallest%20String%20After%20Adjacent%20Removals/README_EN.md +tags: + - String + - Dynamic Programming --- diff --git a/solution/3500-3599/3564.Seasonal Sales Analysis/README.md b/solution/3500-3599/3564.Seasonal Sales Analysis/README.md index 860de61f83848..d0ad338b92881 100644 --- a/solution/3500-3599/3564.Seasonal Sales Analysis/README.md +++ b/solution/3500-3599/3564.Seasonal Sales Analysis/README.md @@ -8,7 +8,7 @@ tags: -# [3564. Seasonal Sales Analysis](https://leetcode.cn/problems/seasonal-sales-analysis) +# [3564. 季节性销售分析](https://leetcode.cn/problems/seasonal-sales-analysis) [English Version](/solution/3500-3599/3564.Seasonal%20Sales%20Analysis/README_EN.md) @@ -16,7 +16,7 @@ tags: -Table: sales
表:sales
+---------------+---------+ @@ -28,11 +28,11 @@ tags: | quantity | int | | price | decimal | +---------------+---------+ -sale_id is the unique identifier for this table. -Each row contains information about a product sale including the product_id, date of sale, quantity sold, and price per unit. +sale_id 是这张表的唯一主键。 +每一行包含一件产品的销售信息,包括 product_id,销售日期,销售数量,以及单价。-
Table: products
表:products
+---------------+---------+ @@ -42,32 +42,33 @@ Each row contains information about a product sale including the product_id, dat | product_name | varchar | | category | varchar | +---------------+---------+ -product_id is the unique identifier for this table. -Each row contains information about a product including its name and category. +product_id 是这张表的唯一主键。 +每一行包含一件产品的信息,包括它的名字和分类。-
Write a solution to find the most popular product category for each season. The seasons are defined as:
+编写一个解决方案来找到每个季节最受欢迎的产品分类。季节定义如下:
The popularity of a category is determined by the total quantity sold in that season. If there is a tie, select the category with the highest total revenue (quantity × price
).
一个 分类 的 受欢迎度 由某个 季节 的 总销售量 决定。如果有并列,选择总收入最高的类别 (quantity × price
)。
Return the result table ordered by season in ascending order.
+返回结果表以季节 升序 排序。
-The result format is in the following example.
+结果格式如下所示。
-
Example:
+ +示例:
Input:
+输入:
-sales table:
+sales 表:
+---------+------------+------------+----------+-------+ @@ -91,7 +92,7 @@ Each row contains information about a product including its name and category. +---------+------------+------------+----------+-------+-
products table:
+products 表:
+------------+-----------------+----------+ @@ -105,7 +106,7 @@ Each row contains information about a product including its name and category. +------------+-----------------+----------+-
Output:
+输出:
+---------+----------+----------------+---------------+ @@ -118,47 +119,47 @@ Each row contains information about a product including its name and category. +---------+----------+----------------+---------------+-
Explanation:
+解释:
The result table is ordered by season in ascending order.
+结果表以季节升序排序。
You are given a 2D array grid
of size m x n
, and an integer k
. There are k
cells in grid
containing the values from 1 to k
exactly once, and the rest of the cells have a value 0.
给定一个 m x n
大小的 2 维数组 grid
,和一个整数 k
。grid
中有 k
个单元格包含从 1 到 k
的值,每个值恰好出现一次,其余单元格的值为 0。
You can start at any cell, and move from a cell to its neighbors (up, down, left, or right). You must find a path in grid
which:
你可以从任何单元格开始,并且从一个单元格移动到相邻的单元格(上,下,左,右)。你必须找到一条 grid
中的路径,满足:
grid
exactly once.k
in order.grid
中的每个单元格 恰好一次。k
的单元格。Return a 2D array result
of size (m * n) x 2
, where result[i] = [xi, yi]
represents the ith
cell visited in the path. If there are multiple such paths, you may return any one.
返回一个大小为 (m * n) x 2
的二维数组 result
,其中 result[i] = [xi, yi]
表示路径中访问的第 i
个单元格。如果存在多条这样的路径,你可以返回 任何 一条。
If no such path exists, return an empty array.
+如果不存在这样的路径,返回一个 空 数组。
-
Example 1:
+ +示例 1:
Input: grid = [[0,0,0],[0,1,2]], k = 2
+输入:grid = [[0,0,0],[0,1,2]], k = 2
-Output: [[0,0],[1,0],[1,1],[1,2],[0,2],[0,1]]
+输出:[[0,0],[1,0],[1,1],[1,2],[0,2],[0,1]]
-Explanation:
+解释:
Example 2:
+示例 2:
Input: grid = [[1,0,4],[3,0,2]], k = 4
+输入:grid = [[1,0,4],[3,0,2]], k = 4
-Output: []
+输出:[]
-Explanation:
+解释:
-There is no possible path that satisfies the conditions.
+没有满足条件的路径。
-
Constraints:
+ +提示:
1 <= m == grid.length <= 6
1 <= n == grid[i].length <= 6
1 <= k <= m * n
0 <= grid[i][j] <= k
grid
contains all integers between 1 and k
exactly once.grid
包含 1 到 k
的所有整数 恰好 一次。