Skip to content

Commit de4ed82

Browse files
authored
feat: add solutions to lc problem: No.3294 (doocs#3534)
No.3294.Convert Doubly Linked List to Array II
1 parent abe25e2 commit de4ed82

File tree

43 files changed

+622
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+622
-23
lines changed

solution/3200-3299/3264.Final Array State After K Multiplication Operations I/README.md

+2
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/3200-3299/3264.Final%20Array%20State%20After%20K%20Multiplication%20Operations%20I/README.md
5+
rating: 1177
6+
source: 第 412 场周赛 Q1
57
tags:
68
- 数组
79
- 数学

solution/3200-3299/3264.Final Array State After K Multiplication Operations I/README_EN.md

+2
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/3200-3299/3264.Final%20Array%20State%20After%20K%20Multiplication%20Operations%20I/README_EN.md
5+
rating: 1177
6+
source: Weekly Contest 412 Q1
57
tags:
68
- Array
79
- Math

solution/3200-3299/3265.Count Almost Equal Pairs I/README.md

+2
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/3200-3299/3265.Count%20Almost%20Equal%20Pairs%20I/README.md
5+
rating: 1661
6+
source: 第 412 场周赛 Q2
57
tags:
68
- 数组
79
- 哈希表

solution/3200-3299/3265.Count Almost Equal Pairs I/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3265.Count%20Almost%20Equal%20Pairs%20I/README_EN.md
5+
rating: 1661
6+
source: Weekly Contest 412 Q2
57
tags:
68
- Array
79
- Hash Table

solution/3200-3299/3266.Final Array State After K Multiplication Operations II/README.md

+2
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/3200-3299/3266.Final%20Array%20State%20After%20K%20Multiplication%20Operations%20II/README.md
5+
rating: 2508
6+
source: 第 412 场周赛 Q3
57
tags:
68
- 数组
79
- 模拟

solution/3200-3299/3266.Final Array State After K Multiplication Operations II/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3266.Final%20Array%20State%20After%20K%20Multiplication%20Operations%20II/README_EN.md
5+
rating: 2508
6+
source: Weekly Contest 412 Q3
57
tags:
68
- Array
79
- Simulation

solution/3200-3299/3267.Count Almost Equal Pairs II/README.md

+2
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/3200-3299/3267.Count%20Almost%20Equal%20Pairs%20II/README.md
5+
rating: 2545
6+
source: 第 412 场周赛 Q4
57
tags:
68
- 数组
79
- 哈希表

solution/3200-3299/3267.Count Almost Equal Pairs II/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3267.Count%20Almost%20Equal%20Pairs%20II/README_EN.md
5+
rating: 2545
6+
source: Weekly Contest 412 Q4
57
tags:
68
- Array
79
- Hash Table

solution/3200-3299/3270.Find the Key of the Numbers/README.md

+2
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/3200-3299/3270.Find%20the%20Key%20of%20the%20Numbers/README.md
5+
rating: 1205
6+
source: 第 138 场双周赛 Q1
57
tags:
68
- 数学
79
---

solution/3200-3299/3270.Find the Key of the Numbers/README_EN.md

+2
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/3200-3299/3270.Find%20the%20Key%20of%20the%20Numbers/README_EN.md
5+
rating: 1205
6+
source: Biweekly Contest 138 Q1
57
tags:
68
- Math
79
---

solution/3200-3299/3271.Hash Divided String/README.md

+2
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/3200-3299/3271.Hash%20Divided%20String/README.md
5+
rating: 1292
6+
source: 第 138 场双周赛 Q2
57
tags:
68
- 字符串
79
- 模拟

solution/3200-3299/3271.Hash Divided String/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3271.Hash%20Divided%20String/README_EN.md
5+
rating: 1292
6+
source: Biweekly Contest 138 Q2
57
tags:
68
- String
79
- Simulation

solution/3200-3299/3272.Find the Count of Good Integers/README.md

+2
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/3200-3299/3272.Find%20the%20Count%20of%20Good%20Integers/README.md
5+
rating: 2382
6+
source: 第 138 场双周赛 Q3
57
tags:
68
- 哈希表
79
- 数学

solution/3200-3299/3272.Find the Count of Good Integers/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3272.Find%20the%20Count%20of%20Good%20Integers/README_EN.md
5+
rating: 2382
6+
source: Biweekly Contest 138 Q3
57
tags:
68
- Hash Table
79
- Math

solution/3200-3299/3273.Minimum Amount of Damage Dealt to Bob/README.md

+2
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/3200-3299/3273.Minimum%20Amount%20of%20Damage%20Dealt%20to%20Bob/README.md
5+
rating: 2012
6+
source: 第 138 场双周赛 Q4
57
tags:
68
- 贪心
79
- 数组

solution/3200-3299/3273.Minimum Amount of Damage Dealt to Bob/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3273.Minimum%20Amount%20of%20Damage%20Dealt%20to%20Bob/README_EN.md
5+
rating: 2012
6+
source: Biweekly Contest 138 Q4
57
tags:
68
- Greedy
79
- Array

solution/3200-3299/3274.Check if Two Chessboard Squares Have the Same Color/README.md

+2
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/3200-3299/3274.Check%20if%20Two%20Chessboard%20Squares%20Have%20the%20Same%20Color/README.md
5+
rating: 1162
6+
source: 第 413 场周赛 Q1
57
tags:
68
- 数学
79
- 字符串

solution/3200-3299/3274.Check if Two Chessboard Squares Have the Same Color/README_EN.md

+2
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/3200-3299/3274.Check%20if%20Two%20Chessboard%20Squares%20Have%20the%20Same%20Color/README_EN.md
5+
rating: 1162
6+
source: Weekly Contest 413 Q1
57
tags:
68
- Math
79
- String

solution/3200-3299/3275.K-th Nearest Obstacle Queries/README.md

+2
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/3200-3299/3275.K-th%20Nearest%20Obstacle%20Queries/README.md
5+
rating: 1419
6+
source: 第 413 场周赛 Q2
57
tags:
68
- 数组
79
- 堆(优先队列)

solution/3200-3299/3275.K-th Nearest Obstacle Queries/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3275.K-th%20Nearest%20Obstacle%20Queries/README_EN.md
5+
rating: 1419
6+
source: Weekly Contest 413 Q2
57
tags:
68
- Array
79
- Heap (Priority Queue)

solution/3200-3299/3276.Select Cells in Grid With Maximum Score/README.md

+2
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/3200-3299/3276.Select%20Cells%20in%20Grid%20With%20Maximum%20Score/README.md
5+
rating: 2402
6+
source: 第 413 场周赛 Q3
57
tags:
68
- 位运算
79
- 数组

solution/3200-3299/3276.Select Cells in Grid With Maximum Score/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3276.Select%20Cells%20in%20Grid%20With%20Maximum%20Score/README_EN.md
5+
rating: 2402
6+
source: Weekly Contest 413 Q3
57
tags:
68
- Bit Manipulation
79
- Array

solution/3200-3299/3277.Maximum XOR Score Subarray Queries/README.md

+2
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/3200-3299/3277.Maximum%20XOR%20Score%20Subarray%20Queries/README.md
5+
rating: 2692
6+
source: 第 413 场周赛 Q4
57
tags:
68
- 数组
79
- 动态规划

solution/3200-3299/3277.Maximum XOR Score Subarray Queries/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3277.Maximum%20XOR%20Score%20Subarray%20Queries/README_EN.md
5+
rating: 2692
6+
source: Weekly Contest 413 Q4
57
tags:
68
- Array
79
- Dynamic Programming

solution/3200-3299/3280.Convert Date to Binary/README.md

+2
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/3200-3299/3280.Convert%20Date%20to%20Binary/README.md
5+
rating: 1205
6+
source: 第 414 场周赛 Q1
57
tags:
68
- 数学
79
- 字符串

solution/3200-3299/3280.Convert Date to Binary/README_EN.md

+2
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/3200-3299/3280.Convert%20Date%20to%20Binary/README_EN.md
5+
rating: 1205
6+
source: Weekly Contest 414 Q1
57
tags:
68
- Math
79
- String

solution/3200-3299/3281.Maximize Score of Numbers in Ranges/README.md

+2
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/3200-3299/3281.Maximize%20Score%20of%20Numbers%20in%20Ranges/README.md
5+
rating: 1768
6+
source: 第 414 场周赛 Q2
57
tags:
68
- 贪心
79
- 数组

solution/3200-3299/3281.Maximize Score of Numbers in Ranges/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3281.Maximize%20Score%20of%20Numbers%20in%20Ranges/README_EN.md
5+
rating: 1768
6+
source: Weekly Contest 414 Q2
57
tags:
68
- Greedy
79
- Array

solution/3200-3299/3282.Reach End of Array With Max Score/README.md

+2
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/3200-3299/3282.Reach%20End%20of%20Array%20With%20Max%20Score/README.md
5+
rating: 1771
6+
source: 第 414 场周赛 Q3
57
tags:
68
- 贪心
79
- 数组

solution/3200-3299/3282.Reach End of Array With Max Score/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3282.Reach%20End%20of%20Array%20With%20Max%20Score/README_EN.md
5+
rating: 1771
6+
source: Weekly Contest 414 Q3
57
tags:
68
- Greedy
79
- Array

solution/3200-3299/3283.Maximum Number of Moves to Kill All Pawns/README.md

+2
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/3200-3299/3283.Maximum%20Number%20of%20Moves%20to%20Kill%20All%20Pawns/README.md
5+
rating: 2473
6+
source: 第 414 场周赛 Q4
57
tags:
68
- 位运算
79
- 广度优先搜索

solution/3200-3299/3283.Maximum Number of Moves to Kill All Pawns/README_EN.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3200-3299/3283.Maximum%20Number%20of%20Moves%20to%20Kill%20All%20Pawns/README_EN.md
5+
rating: 2473
6+
source: Weekly Contest 414 Q4
57
tags:
68
- Bit Manipulation
79
- Breadth-First Search

solution/3200-3299/3293.Calculate Product Final Price/README.md

+22-21
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ tags:
88

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

11-
# [3293. Calculate Product Final Price 🔒](https://leetcode.cn/problems/calculate-product-final-price)
11+
# [3293. 计算产品最终价格 🔒](https://leetcode.cn/problems/calculate-product-final-price)
1212

1313
[English Version](/solution/3200-3299/3293.Calculate%20Product%20Final%20Price/README_EN.md)
1414

1515
## 题目描述
1616

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

19-
<p>Table: <font face="monospace"><code>Products</code></font></p>
19+
<p>表:<font face="monospace"><code>Products</code></font></p>
2020

2121
<pre>
2222
+------------+---------+
@@ -26,11 +26,11 @@ tags:
2626
| category | varchar |
2727
| price | decimal |
2828
+------------+---------+
29-
product_id is the unique key for this table.
30-
Each row includes the product&#39;s ID, its category, and its price.
29+
product_id 是这张表的唯一主键。
30+
每一行包含产品的 ID,分类以及价格。
3131
</pre>
3232

33-
<p>Table: <font face="monospace"><code>Discounts</code></font></p>
33+
<p>表:<font face="monospace"><code>Discounts</code></font></p>
3434

3535
<pre>
3636
+------------+---------+
@@ -39,23 +39,24 @@ Each row includes the product&#39;s ID, its category, and its price.
3939
| category | varchar |
4040
| discount | int |
4141
+------------+---------+
42-
category is the primary key for this table.
43-
Each row contains a product category and the percentage discount applied to that category (values range from 0 to 100).
42+
category 是这张表的主键。
43+
每一行包含有一个产品分类和该分类的折扣百分比(值的范围从 0 到 100)。
4444
</pre>
4545

46-
<p>Write a solution to find the <strong>final price</strong> of each product after applying the <strong>category discount</strong>. If a product&#39;s category has <strong>no</strong> <strong>associated</strong> <strong>discount</strong>, its price remains <strong>unchanged</strong>.</p>
46+
<p>编写一个解决方案来找到每个产品使用 <strong>分类折扣</strong>&nbsp;后的 <strong>最终价格</strong>。如果一个产品分类 <strong>没有关联的折扣</strong>,它的价格保持 <strong>不变</strong></p>
4747

48-
<p>Return <em>the result table ordered by</em> <code>product_id</code><em> in <strong>ascending</strong> order.</em></p>
48+
<p>返回结果表以&nbsp;<code>product_id</code><em> </em><strong>升序&nbsp;</strong>排序。</p>
4949

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

5252
<p>&nbsp;</p>
53-
<p><strong class="example">Example:</strong></p>
53+
54+
<p><strong class="example">示例:</strong></p>
5455

5556
<div class="example-block">
56-
<p><strong>Input:</strong></p>
57+
<p><strong>输入:</strong></p>
5758

58-
<p><code>Products</code> table:</p>
59+
<p><code>Products</code> 表:</p>
5960

6061
<pre class="example-io">
6162
+------------+-------------+-------+
@@ -68,7 +69,7 @@ Each row contains a product category and the percentage discount applied to that
6869
+------------+-------------+-------+
6970
</pre>
7071

71-
<p><code>Discounts</code> table:</p>
72+
<p><code>Discounts</code> 表:</p>
7273

7374
<pre class="example-io">
7475
+------------+----------+
@@ -79,7 +80,7 @@ Each row contains a product category and the percentage discount applied to that
7980
+------------+----------+
8081
</pre>
8182

82-
<p><strong>Output:</strong></p>
83+
<p><strong>输出:</strong></p>
8384

8485
<pre class="example-io">
8586
+------------+------------+-------------+
@@ -92,15 +93,15 @@ Each row contains a product category and the percentage discount applied to that
9293
+------------+------------+-------------+
9394
</pre>
9495

95-
<p><strong>Explanation:</strong></p>
96+
<p><strong>解释:</strong></p>
9697

9798
<ul>
98-
<li>For product 1, it belongs to the Electronics&nbsp;category which has a 10% discount, so the final price is 1000 - (10% of 1000) = 900.</li>
99-
<li>For product 2, it belongs to the Clothing&nbsp;category which has a 20% discount, so the final price is 50 - (20% of 50) = 40.</li>
100-
<li>For product 3, it belongs to the Electronics&nbsp;category and receives a 10% discount, so the final price is 1200 - (10% of 1200) = 1080.</li>
101-
<li>For product 4, no discount is available for the Home&nbsp;category, so the final price remains 500.</li>
99+
<li>对于产品 1,它属于电器分类,有 10% 的折扣,所以最终价格为 1000 - (10% of 1000) = 900</li>
100+
<li>对于产品 2,它属于衣物分类,有 20% 的折扣,所以最终价格为 50 - (20% of 50) = 40</li>
101+
<li>对于产品 3,它属于电器分类,有 10% 的折扣,所以最终价格为&nbsp;1200 - (10% of 1200) = 1080</li>
102+
<li>对于产品 4,它属于家具分类,没有可用的折扣,所以最终价格仍是 500</li>
102103
</ul>
103-
Result table is ordered by product_id in ascending order.</div>
104+
结果表以 product_id 升序排序。</div>
104105

105106
<!-- description:end -->
106107

0 commit comments

Comments
 (0)