Skip to content

Commit 2038cfd

Browse files
authored
feat: update lc problems (#3851)
1 parent 2f350d9 commit 2038cfd

File tree

24 files changed

+191
-84
lines changed

24 files changed

+191
-84
lines changed

solution/3300-3399/3375.Minimum Operations to Make Array Values Equal to K/README.md

+3
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/3300-3399/3375.Minimum%20Operations%20to%20Make%20Array%20Values%20Equal%20to%20K/README.md
5+
tags:
6+
- 数组
7+
- 哈希表
58
---
69

710
<!-- problem:start -->

solution/3300-3399/3375.Minimum Operations to Make Array Values Equal to K/README_EN.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
comments: true
33
difficulty: Easy
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3375.Minimum%20Operations%20to%20Make%20Array%20Values%20Equal%20to%20K/README_EN.md
5+
tags:
6+
- Array
7+
- Hash Table
58
---
69

710
<!-- problem:start -->

solution/3300-3399/3376.Minimum Time to Break Locks I/README.md

+6
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/3300-3399/3376.Minimum%20Time%20to%20Break%20Locks%20I/README.md
5+
tags:
6+
- 位运算
7+
- 数组
8+
- 动态规划
9+
- 回溯
10+
- 状态压缩
511
---
612

713
<!-- problem:start -->

solution/3300-3399/3376.Minimum Time to Break Locks I/README_EN.md

+6
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/3300-3399/3376.Minimum%20Time%20to%20Break%20Locks%20I/README_EN.md
5+
tags:
6+
- Bit Manipulation
7+
- Array
8+
- Dynamic Programming
9+
- Backtracking
10+
- Bitmask
511
---
612

713
<!-- problem:start -->

solution/3300-3399/3377.Digit Operations to Make Two Integers Equal/README.md

+6
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/3300-3399/3377.Digit%20Operations%20to%20Make%20Two%20Integers%20Equal/README.md
5+
tags:
6+
-
7+
- 数学
8+
- 数论
9+
- 最短路
10+
- 堆(优先队列)
511
---
612

713
<!-- problem:start -->

solution/3300-3399/3377.Digit Operations to Make Two Integers Equal/README_EN.md

+6
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/3300-3399/3377.Digit%20Operations%20to%20Make%20Two%20Integers%20Equal/README_EN.md
5+
tags:
6+
- Graph
7+
- Math
8+
- Number Theory
9+
- Shortest Path
10+
- Heap (Priority Queue)
511
---
612

713
<!-- problem:start -->

solution/3300-3399/3378.Count Connected Components in LCM Graph/README.md

+6
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/3300-3399/3378.Count%20Connected%20Components%20in%20LCM%20Graph/README.md
5+
tags:
6+
- 并查集
7+
- 数组
8+
- 哈希表
9+
- 数学
10+
- 数论
511
---
612

713
<!-- problem:start -->

solution/3300-3399/3378.Count Connected Components in LCM Graph/README_EN.md

+6
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/3300-3399/3378.Count%20Connected%20Components%20in%20LCM%20Graph/README_EN.md
5+
tags:
6+
- Union Find
7+
- Array
8+
- Hash Table
9+
- Math
10+
- Number Theory
511
---
612

713
<!-- problem:start -->

solution/3300-3399/3379.Transformed Array/README.md

+3
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/3300-3399/3379.Transformed%20Array/README.md
5+
tags:
6+
- 数组
7+
- 模拟
58
---
69

710
<!-- problem:start -->

solution/3300-3399/3379.Transformed Array/README_EN.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
comments: true
33
difficulty: Easy
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3379.Transformed%20Array/README_EN.md
5+
tags:
6+
- Array
7+
- Simulation
58
---
69

710
<!-- problem:start -->

solution/3300-3399/3380.Maximum Area Rectangle With Point Constraints I/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
comments: true
33
difficulty: 中等
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3380.Maximum%20Area%20Rectangle%20With%20Point%20Constraints%20I/README.md
5+
tags:
6+
- 树状数组
7+
- 线段树
8+
- 几何
9+
- 数组
10+
- 数学
11+
- 枚举
12+
- 排序
513
---
614

715
<!-- problem:start -->

solution/3300-3399/3380.Maximum Area Rectangle With Point Constraints I/README_EN.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
comments: true
33
difficulty: Medium
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3380.Maximum%20Area%20Rectangle%20With%20Point%20Constraints%20I/README_EN.md
5+
tags:
6+
- Binary Indexed Tree
7+
- Segment Tree
8+
- Geometry
9+
- Array
10+
- Math
11+
- Enumeration
12+
- Sorting
513
---
614

715
<!-- problem:start -->

solution/3300-3399/3381.Maximum Subarray Sum With Length Divisible by K/README.md

+4
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/3300-3399/3381.Maximum%20Subarray%20Sum%20With%20Length%20Divisible%20by%20K/README.md
5+
tags:
6+
- 数组
7+
- 哈希表
8+
- 前缀和
59
---
610

711
<!-- problem:start -->

solution/3300-3399/3381.Maximum Subarray Sum With Length Divisible by K/README_EN.md

+4
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/3300-3399/3381.Maximum%20Subarray%20Sum%20With%20Length%20Divisible%20by%20K/README_EN.md
5+
tags:
6+
- Array
7+
- Hash Table
8+
- Prefix Sum
59
---
610

711
<!-- problem:start -->

solution/3300-3399/3382.Maximum Area Rectangle With Point Constraints II/README.md

+7
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/3300-3399/3382.Maximum%20Area%20Rectangle%20With%20Point%20Constraints%20II/README.md
5+
tags:
6+
- 树状数组
7+
- 线段树
8+
- 几何
9+
- 数组
10+
- 数学
11+
- 排序
512
---
613

714
<!-- problem:start -->

solution/3300-3399/3382.Maximum Area Rectangle With Point Constraints II/README_EN.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3382.Maximum%20Area%20Rectangle%20With%20Point%20Constraints%20II/README_EN.md
5+
tags:
6+
- Binary Indexed Tree
7+
- Segment Tree
8+
- Geometry
9+
- Array
10+
- Math
11+
- Sorting
512
---
613

714
<!-- problem:start -->

solution/3300-3399/3383.Minimum Runes to Add to Cast Spell/README.md

+29-21
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,75 @@
22
comments: true
33
difficulty: 困难
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3383.Minimum%20Runes%20to%20Add%20to%20Cast%20Spell/README.md
5+
tags:
6+
- 深度优先搜索
7+
- 广度优先搜索
8+
-
9+
- 拓扑排序
10+
- 数组
511
---
612

713
<!-- problem:start -->
814

9-
# [3383. Minimum Runes to Add to Cast Spell 🔒](https://leetcode.cn/problems/minimum-runes-to-add-to-cast-spell)
15+
# [3383. 施法所需最低符文数量 🔒](https://leetcode.cn/problems/minimum-runes-to-add-to-cast-spell)
1016

1117
[English Version](/solution/3300-3399/3383.Minimum%20Runes%20to%20Add%20to%20Cast%20Spell/README_EN.md)
1218

1319
## 题目描述
1420

1521
<!-- description:start -->
1622

17-
<p>Alice has just graduated from wizard school, and wishes to cast a magic spell to celebrate. The magic spell contains certain <strong>focus points</strong> where magic needs to be concentrated, and some of these focus points contain <strong>magic crystals</strong> which serve as the spell&#39;s energy source. Focus points can be linked through <strong>directed runes</strong>, which channel magic flow from one focus point to another.</p>
23+
<p>Alice 刚刚从巫师学校毕业,并且希望施展一个魔法咒语来庆祝。魔法咒语包含某些需要集中魔力的焦点,其中一些焦点含有作为咒语能量源的魔法水晶。焦点可以通过 <strong>有向符文</strong>&nbsp;进行连接,这些符文将魔力流从一个焦点传输到另一个焦点。</p>
1824

19-
<p>You are given a integer <code>n</code> denoting the <em>number</em> of focus points and an array of integers <code>crystals</code> where <code>crystals[i]</code> indicates a focus point which holds a magic crystal. You are also given two integer arrays <code>flowFrom</code> and <code>flowTo</code>, which represent the existing <strong>directed runes</strong>. The <code>i<sup>th</sup></code> rune allows magic to freely flow from focus point <code>flowFrom[i]</code> to focus point <code>flowTo[i]</code>.</p>
25+
<p>给定一个整数&nbsp;<code>n</code>&nbsp;表示焦点的数量,以及一个整数数组&nbsp;<code>crystals</code>,其中&nbsp;<code>crystals[i]</code>&nbsp;表示有魔法水晶的焦点。同时给定两个整数数组&nbsp;<code>flowFrom</code> &nbsp;<code>flowTo</code>,表示存在的 <strong>有向符文</strong>。第&nbsp;<code>i<sup>th</sup></code>&nbsp;个符文允许魔力流从焦点&nbsp;<code>flowFrom[i]</code>&nbsp;传输到焦点&nbsp;<code>flowTo[i]</code></p>
2026

21-
<p>You need to find the number of directed runes Alice must add to her spell, such that <em>each</em> focus point either:</p>
27+
<p>你需要找到 Alice 必须添加到她的咒语中的定向符文数量,使得每个焦点要么:</p>
2228

2329
<ul>
24-
<li><strong>Contains</strong> a magic crystal.</li>
25-
<li><strong>Receives</strong> magic flow <em>from</em> another focus point.</li>
30+
<li><strong>包含</strong>&nbsp;一个魔法水晶。</li>
31+
<li>从其它焦点&nbsp;<strong>接收</strong>&nbsp;魔力流。</li>
2632
</ul>
2733

28-
<p>Return the <strong>minimum</strong> number of directed runes that she should add.</p>
34+
<p>返回她所需要添加的 <strong>最少</strong>&nbsp;有向符文数量。</p>
2935

3036
<p>&nbsp;</p>
31-
<p><strong class="example">Example 1:</strong></p>
37+
38+
<p><strong class="example">示例 1:</strong></p>
3239

3340
<div class="example-block">
34-
<p><strong>Input:</strong> <span class="example-io">n = 6, crystals = [0], flowFrom = [0,1,2,3], flowTo = [1,2,3,0]</span></p>
41+
<p><strong>输入:</strong><span class="example-io">n = 6, crystals = [0], flowFrom = [0,1,2,3], flowTo = [1,2,3,0]</span></p>
3542

36-
<p><strong>Output:</strong> <span class="example-io">2</span></p>
43+
<p><span class="example-io"><b>输出:</b>2</span></p>
3744

38-
<p><strong>Explanation:</strong>&nbsp;</p>
45+
<p><b>解释:</b></p>
3946

4047
<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/3300-3399/3383.Minimum%20Runes%20to%20Add%20to%20Cast%20Spell/images/runesexample0.png" style="width: 250px; height: 252px;" /></p>
4148

42-
<p>Add two directed runes:</p>
49+
<p>添加两个有向符文:</p>
4350

4451
<ul>
45-
<li>From focus point&nbsp;0 to focus point&nbsp;4.</li>
46-
<li>From focus point 0 to focus point 5.</li>
52+
<li>从焦点 0 到焦点 4。</li>
53+
<li>从焦点 0 到焦点 5。</li>
4754
</ul>
4855
</div>
4956

50-
<p><strong class="example">Example 2:</strong></p>
57+
<p><strong class="example">示例 2:</strong></p>
5158

5259
<div class="example-block">
53-
<p><strong>Input:</strong> <span class="example-io">n = 7, crystals = [3,5], flowFrom = [0,1,2,3,5], flowTo = [1,2,0,4,6]</span></p>
60+
<p><span class="example-io"><b>输入:</b>n = 7, crystals = [3,5], flowFrom = [0,1,2,3,5], flowTo = [1,2,0,4,6]</span></p>
5461

55-
<p><strong>Output:</strong> <span class="example-io">1</span></p>
62+
<p><span class="example-io"><b>输出:</b>1</span></p>
5663

57-
<p><strong>Explanation:</strong>&nbsp;</p>
64+
<p><b>解释:</b></p>
5865

5966
<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/3300-3399/3383.Minimum%20Runes%20to%20Add%20to%20Cast%20Spell/images/runesexample1.png" style="width: 250px; height: 250px;" /></p>
6067

61-
<p>Add a directed rune from focus point 4 to focus point 2.</p>
68+
<p>添加从焦点 4 到焦点 2 的有向符文。</p>
6269
</div>
6370

6471
<p>&nbsp;</p>
65-
<p><strong>Constraints:</strong></p>
72+
73+
<p><strong>提示:</strong></p>
6674

6775
<ul>
6876
<li><code>2 &lt;= n &lt;= 10<sup>5</sup></code></li>
@@ -71,7 +79,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3383.Mi
7179
<li><code>1 &lt;= flowFrom.length == flowTo.length &lt;= min(2 * 10<sup>5</sup>, (n * (n - 1)) / 2)</code></li>
7280
<li><code>0 &lt;= flowFrom[i], flowTo[i] &lt;= n - 1</code></li>
7381
<li><code>flowFrom[i] != flowTo[i]</code></li>
74-
<li>All pre-existing directed runes are <strong>distinct</strong>.</li>
82+
<li>所有的有向符文 <strong>互不相同</strong></li>
7583
</ul>
7684

7785
<!-- description:end -->

solution/3300-3399/3383.Minimum Runes to Add to Cast Spell/README_EN.md

+6
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/3300-3399/3383.Minimum%20Runes%20to%20Add%20to%20Cast%20Spell/README_EN.md
5+
tags:
6+
- Depth-First Search
7+
- Breadth-First Search
8+
- Graph
9+
- Topological Sort
10+
- Array
511
---
612

713
<!-- problem:start -->

0 commit comments

Comments
 (0)