Skip to content

Commit c7a3051

Browse files
authored
feat: update lc problems (#4449)
1 parent 18565c4 commit c7a3051

File tree

26 files changed

+173
-86
lines changed

26 files changed

+173
-86
lines changed

solution/3500-3599/3549.Multiply Two Polynomials/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tags:
2121

2222
<p>设&nbsp;<code>A(x)</code> 和&nbsp;<code>B(x)</code>&nbsp;分别是&nbsp;<code>poly1</code> 和&nbsp;<code>poly2</code>&nbsp;表示的多项式。</p>
2323

24-
<p>返回一个整数数组&nbsp;<code>result</code>&nbsp;表示乘积多项式 <code>R(x) = A(x) * B(x)</code>&nbsp;的系数,其中&nbsp;<code>result[i]</code>&nbsp;表示&nbsp;<code>R(x)</code>&nbsp;中 <code>x<sup>i</sup></code>&nbsp;的系数。</p>
24+
<p>返回一个长度为&nbsp;<code>(poly1.length + poly2.length - 1)</code>&nbsp;的整数数组&nbsp;<code>result</code>&nbsp;表示乘积多项式 <code>R(x) = A(x) * B(x)</code>&nbsp;的系数,其中&nbsp;<code>result[i]</code>&nbsp;表示&nbsp;<code>R(x)</code>&nbsp;中 <code>x<sup>i</sup></code>&nbsp;的系数。</p>
2525

2626
<p>&nbsp;</p>
2727

solution/3500-3599/3549.Multiply Two Polynomials/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tags:
2121

2222
<p>Let <code>A(x)</code> and <code>B(x)</code> be the polynomials represented by <code>poly1</code> and <code>poly2</code>, respectively.</p>
2323

24-
<p>Return an integer array <code>result</code> representing the coefficients of the product polynomial <code>R(x) = A(x) * B(x)</code>, where <code>result[i]</code> denotes the coefficient of <code>x<sup>i</sup></code> in <code>R(x)</code>.</p>
24+
<p>Return an integer array <code>result</code> of length <code>(poly1.length + poly2.length - 1)</code> representing the coefficients of the product polynomial <code>R(x) = A(x) * B(x)</code>, where <code>result[i]</code> denotes the coefficient of <code>x<sup>i</sup></code> in <code>R(x)</code>.</p>
2525

2626
<p>&nbsp;</p>
2727
<p><strong class="example">Example 1:</strong></p>

solution/3500-3599/3555.Smallest Subarray to Sort in Every Sliding Window/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
comments: true
33
difficulty: 中等
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3555.Smallest%20Subarray%20to%20Sort%20in%20Every%20Sliding%20Window/README.md
5+
tags:
6+
-
7+
- 贪心
8+
- 数组
9+
- 双指针
10+
- 排序
11+
- 单调栈
512
---
613

714
<!-- problem:start -->

solution/3500-3599/3555.Smallest Subarray to Sort in Every Sliding Window/README_EN.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3555.Smallest%20Subarray%20to%20Sort%20in%20Every%20Sliding%20Window/README_EN.md
5+
tags:
6+
- Stack
7+
- Greedy
8+
- Array
9+
- Two Pointers
10+
- Sorting
11+
- Monotonic Stack
512
---
613

714
<!-- problem:start -->

solution/3500-3599/3556.Sum of Largest Prime Substrings/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
comments: true
33
difficulty: 中等
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3556.Sum%20of%20Largest%20Prime%20Substrings/README.md
5+
tags:
6+
- 哈希表
7+
- 数学
8+
- 字符串
9+
- 数论
10+
- 排序
511
---
612

713
<!-- problem:start -->

solution/3500-3599/3556.Sum of Largest Prime Substrings/README_EN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3556.Sum%20of%20Largest%20Prime%20Substrings/README_EN.md
5+
tags:
6+
- Hash Table
7+
- Math
8+
- String
9+
- Number Theory
10+
- Sorting
511
---
612

713
<!-- problem:start -->

solution/3500-3599/3557.Find Maximum Number of Non Intersecting Substrings/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
comments: true
33
difficulty: 中等
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3557.Find%20Maximum%20Number%20of%20Non%20Intersecting%20Substrings/README.md
5+
tags:
6+
- 贪心
7+
- 哈希表
8+
- 字符串
9+
- 动态规划
510
---
611

712
<!-- problem:start -->

solution/3500-3599/3557.Find Maximum Number of Non Intersecting Substrings/README_EN.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3557.Find%20Maximum%20Number%20of%20Non%20Intersecting%20Substrings/README_EN.md
5+
tags:
6+
- Greedy
7+
- Hash Table
8+
- String
9+
- Dynamic Programming
510
---
611

712
<!-- problem:start -->

solution/3500-3599/3558.Number of Ways to Assign Edge Weights I/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
comments: true
33
difficulty: 中等
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3558.Number%20of%20Ways%20to%20Assign%20Edge%20Weights%20I/README.md
5+
tags:
6+
-
7+
- 深度优先搜索
8+
- 数学
59
---
610

711
<!-- problem:start -->

solution/3500-3599/3558.Number of Ways to Assign Edge Weights I/README_EN.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3558.Number%20of%20Ways%20to%20Assign%20Edge%20Weights%20I/README_EN.md
5+
tags:
6+
- Tree
7+
- Depth-First Search
8+
- Math
59
---
610

711
<!-- problem:start -->

solution/3500-3599/3559.Number of Ways to Assign Edge Weights II/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
comments: true
33
difficulty: 困难
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3559.Number%20of%20Ways%20to%20Assign%20Edge%20Weights%20II/README.md
5+
tags:
6+
-
7+
- 深度优先搜索
8+
- 数组
9+
- 数学
10+
- 动态规划
511
---
612

713
<!-- problem:start -->

solution/3500-3599/3559.Number of Ways to Assign Edge Weights II/README_EN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3559.Number%20of%20Ways%20to%20Assign%20Edge%20Weights%20II/README_EN.md
5+
tags:
6+
- Tree
7+
- Depth-First Search
8+
- Array
9+
- Math
10+
- Dynamic Programming
511
---
612

713
<!-- problem:start -->

solution/3500-3599/3560.Find Minimum Log Transportation Cost/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: 简单
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3560.Find%20Minimum%20Log%20Transportation%20Cost/README.md
5+
tags:
6+
- 数学
57
---
68

79
<!-- problem:start -->

solution/3500-3599/3560.Find Minimum Log Transportation Cost/README_EN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Easy
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3560.Find%20Minimum%20Log%20Transportation%20Cost/README_EN.md
5+
tags:
6+
- Math
57
---
68

79
<!-- problem:start -->

solution/3500-3599/3561.Resulting String After Adjacent Removals/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
comments: true
33
difficulty: 中等
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3561.Resulting%20String%20After%20Adjacent%20Removals/README.md
5+
tags:
6+
-
7+
- 字符串
8+
- 模拟
59
---
610

711
<!-- problem:start -->

solution/3500-3599/3561.Resulting String After Adjacent Removals/README_EN.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3561.Resulting%20String%20After%20Adjacent%20Removals/README_EN.md
5+
tags:
6+
- Stack
7+
- String
8+
- Simulation
59
---
610

711
<!-- problem:start -->

solution/3500-3599/3562.Maximum Profit from Trading Stocks with Discounts/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
comments: true
33
difficulty: 困难
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3562.Maximum%20Profit%20from%20Trading%20Stocks%20with%20Discounts/README.md
5+
tags:
6+
-
7+
- 深度优先搜索
8+
- 数组
9+
- 动态规划
510
---
611

712
<!-- problem:start -->

solution/3500-3599/3562.Maximum Profit from Trading Stocks with Discounts/README_EN.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3562.Maximum%20Profit%20from%20Trading%20Stocks%20with%20Discounts/README_EN.md
5+
tags:
6+
- Tree
7+
- Depth-First Search
8+
- Array
9+
- Dynamic Programming
510
---
611

712
<!-- problem:start -->

solution/3500-3599/3563.Lexicographically Smallest String After Adjacent Removals/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
comments: true
33
difficulty: 困难
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3563.Lexicographically%20Smallest%20String%20After%20Adjacent%20Removals/README.md
5+
tags:
6+
- 字符串
7+
- 动态规划
58
---
69

710
<!-- problem:start -->

solution/3500-3599/3563.Lexicographically Smallest String After Adjacent Removals/README_EN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3563.Lexicographically%20Smallest%20String%20After%20Adjacent%20Removals/README_EN.md
5+
tags:
6+
- String
7+
- Dynamic Programming
58
---
69

710
<!-- problem:start -->

solution/3500-3599/3564.Seasonal Sales Analysis/README.md

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ tags:
88

99
<!-- problem:start -->
1010

11-
# [3564. Seasonal Sales Analysis](https://leetcode.cn/problems/seasonal-sales-analysis)
11+
# [3564. 季节性销售分析](https://leetcode.cn/problems/seasonal-sales-analysis)
1212

1313
[English Version](/solution/3500-3599/3564.Seasonal%20Sales%20Analysis/README_EN.md)
1414

1515
## 题目描述
1616

1717
<!-- description:start -->
1818

19-
<p>Table: <code>sales</code></p>
19+
<p>表:<code>sales</code></p>
2020

2121
<pre>
2222
+---------------+---------+
@@ -28,11 +28,11 @@ tags:
2828
| quantity | int |
2929
| price | decimal |
3030
+---------------+---------+
31-
sale_id is the unique identifier for this table.
32-
Each row contains information about a product sale including the product_id, date of sale, quantity sold, and price per unit.
31+
sale_id 是这张表的唯一主键。
32+
每一行包含一件产品的销售信息,包括 product_id,销售日期,销售数量,以及单价。
3333
</pre>
3434

35-
<p>Table: <code>products</code></p>
35+
<p>表:<code>products</code></p>
3636

3737
<pre>
3838
+---------------+---------+
@@ -42,32 +42,33 @@ Each row contains information about a product sale including the product_id, dat
4242
| product_name | varchar |
4343
| category | varchar |
4444
+---------------+---------+
45-
product_id is the unique identifier for this table.
46-
Each row contains information about a product including its name and category.
45+
product_id 是这张表的唯一主键。
46+
每一行包含一件产品的信息,包括它的名字和分类。
4747
</pre>
4848

49-
<p>Write a solution to find the most popular product category for each season. The seasons are defined as:</p>
49+
<p>编写一个解决方案来找到每个季节最受欢迎的产品分类。季节定义如下:</p>
5050

5151
<ul>
52-
<li><strong>Winter</strong>: December, January, February</li>
53-
<li><strong>Spring</strong>: March, April, May</li>
54-
<li><strong>Summer</strong>: June, July, August</li>
55-
<li><strong>Fall</strong>: September, October, November</li>
52+
<li><strong>冬季</strong>:十二月,一月,二月</li>
53+
<li><strong>春季</strong>:三月,四月,五月</li>
54+
<li><strong>夏季</strong>:六月,七月,八月</li>
55+
<li><strong>秋季</strong>:九月,十月,十一月</li>
5656
</ul>
5757

58-
<p>The <strong>popularity</strong> of a <strong>category</strong> is determined by the <strong>total quantity sold</strong> in that <strong>season</strong>. If there is a <strong>tie</strong>, select the category with the highest <strong>total revenue</strong> (<code>quantity &times; price</code>).</p>
58+
<p>一个 <strong>分类</strong>&nbsp;的 <b>受欢迎度</b>&nbsp;由某个 <strong>季节</strong>&nbsp;<strong>总销售量</strong>&nbsp;决定。如果有并列,选择总收入最高的类别 (<code>quantity × price</code>)</p>
5959

60-
<p>Return <em>the result table ordered by season in <strong>ascending</strong> order</em>.</p>
60+
<p>返回结果表以季节 <strong>升序</strong>&nbsp;排序。</p>
6161

62-
<p>The result format is in the following example.</p>
62+
<p>结果格式如下所示。</p>
6363

6464
<p>&nbsp;</p>
65-
<p><strong class="example">Example:</strong></p>
65+
66+
<p><strong class="example">示例:</strong></p>
6667

6768
<div class="example-block">
68-
<p><strong>Input:</strong></p>
69+
<p><strong>输入:</strong></p>
6970

70-
<p>sales table:</p>
71+
<p>sales 表:</p>
7172

7273
<pre class="example-io">
7374
+---------+------------+------------+----------+-------+
@@ -91,7 +92,7 @@ Each row contains information about a product including its name and category.
9192
+---------+------------+------------+----------+-------+
9293
</pre>
9394

94-
<p>products table:</p>
95+
<p>products 表:</p>
9596

9697
<pre class="example-io">
9798
+------------+-----------------+----------+
@@ -105,7 +106,7 @@ Each row contains information about a product including its name and category.
105106
+------------+-----------------+----------+
106107
</pre>
107108

108-
<p><strong>Output:</strong></p>
109+
<p><strong>输出:</strong></p>
109110

110111
<pre class="example-io">
111112
+---------+----------+----------------+---------------+
@@ -118,47 +119,47 @@ Each row contains information about a product including its name and category.
118119
+---------+----------+----------------+---------------+
119120
</pre>
120121

121-
<p><strong>Explanation:</strong></p>
122+
<p><strong>解释:</strong></p>
122123

123124
<ul>
124-
<li><strong>Fall (Sep, Oct, Nov):</strong>
125+
<li><strong>秋季(九月,十月,十一月):</strong>
125126

126127
<ul>
127-
<li>Apparel: 10 items sold (6 Jackets in Sep, 4 Jeans in Nov), revenue $120.00 (6&times;$10.00 + 4&times;$15.00)</li>
128-
<li>Fitness: 3 Yoga Mats sold in Sep, revenue $36.00</li>
129-
<li>Most popular: Apparel with highest total quantity (10)</li>
128+
<li>服装:售出 10 件商品(在 9 月有 6 件夹克,在 11 月 有 4 条牛仔裤),收入 $120.00(6×$10.00 + 4×$15.00</li>
129+
<li>健身: 9 月售出&nbsp;3 张瑜伽垫,收入&nbsp;$36.00</li>
130+
<li>最受欢迎:服装总数量最多(10)</li>
130131
</ul>
131132
</li>
132-
<li><strong>Spring (Mar, Apr, May):</strong>
133+
<li><strong>春季(三月,四月,五月):</strong>
133134
<ul>
134-
<li>Kitchen: 3 Cutting Boards sold in Mar, revenue $54.00</li>
135-
<li>Tech: 1 Smart Speaker sold in Apr, revenue $20.00</li>
136-
<li>Apparel: 2 Warm Jackets sold in May, revenue $20.00</li>
137-
<li>Most popular: Kitchen with highest total quantity (3) and highest revenue ($54.00)</li>
135+
<li>厨房:5 月 售出 3 张菜板,收入 $54.00</li>
136+
<li>科技:4 月 售出 1 台智能音箱,收入&nbsp;$20.00</li>
137+
<li>服装: 五月售出 2 件保暖夹克,收入&nbsp;$20.00</li>
138+
<li>最受欢迎:厨房总数量最多(3)且收入最多($54.00</li>
138139
</ul>
139140
</li>
140-
<li><strong>Summer (Jun, Jul, Aug):</strong>
141+
<li><strong>夏季(六月,七月,八月</strong><strong>):</strong>
141142
<ul>
142-
<li>Apparel: 4 Designer Jeans sold in Jun, revenue $60.00</li>
143-
<li>Fitness: 5 Yoga Mats sold in Jun, revenue $60.00</li>
144-
<li>Kitchen: 2 Cutting Boards sold in Jul, revenue $36.00</li>
145-
<li>Tech: 5 Smart Speakers sold in Aug, revenue $100.00</li>
146-
<li>Most popular: Tech and Fitness both have 5 items, but Tech has higher revenue ($100.00 vs $60.00)</li>
143+
<li>服装:六月售出 4 件名牌牛仔裤,收入 $60.00</li>
144+
<li>健身:六月售出 5&nbsp;张瑜伽垫,收入&nbsp;$60.00</li>
145+
<li>厨房:七月售出 2&nbsp;张菜板,收入 $36.00</li>
146+
<li>科技:八月售出 5&nbsp;台智能音箱,收入&nbsp;$100.00</li>
147+
<li>最受欢迎:科技和健身都有 5 件商品,但科技收入更多($100.00 vs $60.00</li>
147148
</ul>
148149
</li>
149-
<li><strong>Winter (Dec, Jan, Feb):</strong>
150+
<li><strong>冬季(十二月,一月,二月</strong><strong>):</strong>
150151
<ul>
151-
<li>Apparel: 9 items sold (5 Jackets in Jan, 4 Jeans in Jan), revenue $110.00</li>
152-
<li>Kitchen: 6 Cutting Boards sold in Dec, revenue $108.00</li>
153-
<li>Tech: 3 Smart Speakers sold in Dec, revenue $60.00</li>
154-
<li>Fitness: 2 Yoga Mats sold in Feb, revenue $24.00</li>
155-
<li>Most popular: Apparel with highest total quantity (9) and highest revenue ($110.00)</li>
152+
<li>服装:售出 9 件商品(一月有 5 件夹克和&nbsp;4 条牛仔裤),收入 $110.00</li>
153+
<li>厨房:十二月售出 6 张菜板,收入 $108.00</li>
154+
<li>科技:十二月售出 3 台智能音箱,收入 $60.00</li>
155+
<li>健身:二月售出 2 张瑜伽垫,收入 $24.00</li>
156+
<li>最受欢迎:服装总数量最多(9)且收入最多($110.00</li>
156157
</ul>
157158
</li>
158159

159160
</ul>
160161

161-
<p>The result table is ordered by season in ascending order.</p>
162+
<p>结果表以季节升序排序。</p>
162163
</div>
163164

164165
<!-- description:end -->

0 commit comments

Comments
 (0)