Skip to content

Commit b26ca5e

Browse files
authored
feat: add solutions to lc problems: No.3398,3399 (#3880)
* No.3398.Smallest Substring With Identical Characters I * No.3399.Smallest Substring With Identical Characters II
1 parent a2feb8c commit b26ca5e

File tree

35 files changed

+1420
-56
lines changed

35 files changed

+1420
-56
lines changed

solution/0900-0999/0977.Squares of a Sorted Array/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tags:
2323
<ul>
2424
</ul>
2525

26-
<p>&nbsp;</p>
26+
<p> </p>
2727

2828
<p><strong>示例 1:</strong></p>
2929

@@ -40,22 +40,22 @@ tags:
4040
<strong>输出:</strong>[4,9,9,49,121]
4141
</pre>
4242

43-
<p>&nbsp;</p>
43+
<p> </p>
4444

4545
<p><strong>提示:</strong></p>
4646

4747
<ul>
48-
<li><code><span>1 &lt;= nums.length &lt;= </span>10<sup>4</sup></code></li>
49-
<li><code>-10<sup>4</sup> &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
48+
<li><code><span>1 <= nums.length <= </span>10<sup>4</sup></code></li>
49+
<li><code>-10<sup>4</sup> <= nums[i] <= 10<sup>4</sup></code></li>
5050
<li><code>nums</code> 已按 <strong>非递减顺序</strong> 排序</li>
5151
</ul>
5252

53-
<p>&nbsp;</p>
53+
<p> </p>
5454

5555
<p><strong>进阶:</strong></p>
5656

5757
<ul>
58-
<li>请你设计时间复杂度为 <code>O(n)</code> 的算法解决本问题</li>
58+
<li>请你<span style="color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">设计时间复杂度为 <code>O(n)</code> 的算法解决本问题</span></li>
5959
</ul>
6060

6161
<!-- description:end -->

solution/1800-1899/1891.Cutting Ribbons/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ tags:
2929
<li>切割成四条长度为 <code>1</code>&nbsp;的绳子。</li>
3030
</ul>
3131

32-
<p>你的任务是找出最大 <code>x</code> 值,要求满足可以裁切出至少&nbsp;<code>k</code> 条长度均为 <code>x</code> 的绳子。你可以丢弃裁切后剩余的任意长度的绳子。如果不可能切割出&nbsp;<code>k</code> 条相同长度的绳子,返回 0。</p>
32+
<p>你的任务是找出最大 <code>x</code> 值,要求满足可以裁切出恰好 <code>k</code> 条长度均为 <code>x</code> 的绳子。你可以丢弃裁切后剩余的任意长度的绳子。如果不可能切割出&nbsp;<code>k</code> 条相同长度的绳子,返回 0。</p>
3333

3434
<p>&nbsp;</p>
3535

solution/3300-3399/3369.Design an Array Statistics Tracker/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ comments: true
33
difficulty: 困难
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3369.Design%20an%20Array%20Statistics%20Tracker/README.md
55
tags:
6+
- 设计
67
- 队列
78
- 哈希表
89
- 二分查找
10+
- 数据流
11+
- 有序集合
12+
- 堆(优先队列)
913
---
1014

1115
<!-- problem:start -->

solution/3300-3399/3369.Design an Array Statistics Tracker/README_EN.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ comments: true
33
difficulty: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3369.Design%20an%20Array%20Statistics%20Tracker/README_EN.md
55
tags:
6+
- Design
67
- Queue
78
- Hash Table
89
- Binary Search
10+
- Data Stream
11+
- Ordered Set
12+
- Heap (Priority Queue)
913
---
1014

1115
<!-- problem:start -->

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ tags:
2626

2727
<ul>
2828
<li>The initial energy of the sword is 0.</li>
29-
<li>The initial factor <code><font face="monospace">X</font></code> by which the energy of the sword increases is 1.</li>
30-
<li>Every minute, the energy of the sword increases by the current factor <code>X</code>.</li>
29+
<li>The initial factor <code><font face="monospace">x</font></code> by which the energy of the sword increases is 1.</li>
30+
<li>Every minute, the energy of the sword increases by the current factor <code>x</code>.</li>
3131
<li>To break the <code>i<sup>th</sup></code> lock, the energy of the sword must reach <strong>at least</strong> <code>strength[i]</code>.</li>
32-
<li>After breaking a lock, the energy of the sword resets to 0, and the factor <code>X</code> increases by a given value <code>K</code>.</li>
32+
<li>After breaking a lock, the energy of the sword resets to 0, and the factor <code>x</code> increases by a given value <code>k</code>.</li>
3333
</ul>
3434

3535
<p>Your task is to determine the <strong>minimum</strong> time in minutes required for Bob to break all <code>n</code> locks and escape the dungeon.</p>
@@ -40,7 +40,7 @@ tags:
4040
<p><strong class="example">Example 1:</strong></p>
4141

4242
<div class="example-block">
43-
<p><strong>Input:</strong> <span class="example-io">strength = [3,4,1], K = 1</span></p>
43+
<p><strong>Input:</strong> <span class="example-io">strength = [3,4,1], k = 1</span></p>
4444

4545
<p><strong>Output:</strong> <span class="example-io">4</span></p>
4646

@@ -51,9 +51,9 @@ tags:
5151
<tr>
5252
<th style="border: 1px solid black;">Time</th>
5353
<th style="border: 1px solid black;">Energy</th>
54-
<th style="border: 1px solid black;">X</th>
54+
<th style="border: 1px solid black;">x</th>
5555
<th style="border: 1px solid black;">Action</th>
56-
<th style="border: 1px solid black;">Updated X</th>
56+
<th style="border: 1px solid black;">Updated x</th>
5757
</tr>
5858
<tr>
5959
<td style="border: 1px solid black;">0</td>
@@ -99,7 +99,7 @@ tags:
9999
<p><strong class="example">Example 2:</strong></p>
100100

101101
<div class="example-block">
102-
<p><strong>Input:</strong> <span class="example-io">strength = [2,5,4], K = 2</span></p>
102+
<p><strong>Input:</strong> <span class="example-io">strength = [2,5,4], k = 2</span></p>
103103

104104
<p><strong>Output:</strong> <span class="example-io">5</span></p>
105105

@@ -110,9 +110,9 @@ tags:
110110
<tr>
111111
<th style="border: 1px solid black;">Time</th>
112112
<th style="border: 1px solid black;">Energy</th>
113-
<th style="border: 1px solid black;">X</th>
113+
<th style="border: 1px solid black;">x</th>
114114
<th style="border: 1px solid black;">Action</th>
115-
<th style="border: 1px solid black;">Updated X</th>
115+
<th style="border: 1px solid black;">Updated x</th>
116116
</tr>
117117
<tr>
118118
<td style="border: 1px solid black;">0</td>

solution/3300-3399/3385.Minimum Time to Break Locks II/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/3300-3399/3385.Minimum%20Time%20to%20Break%20Locks%20II/README.md
5+
tags:
6+
- 深度优先搜索
7+
-
8+
- 数组
59
---
610

711
<!-- problem:start -->

solution/3300-3399/3385.Minimum Time to Break Locks II/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: Hard
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3385.Minimum%20Time%20to%20Break%20Locks%20II/README_EN.md
5+
tags:
6+
- Depth-First Search
7+
- Graph
8+
- Array
59
---
610

711
<!-- problem:start -->

solution/3300-3399/3386.Button with Longest Push Time/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/3300-3399/3386.Button%20with%20Longest%20Push%20Time/README.md
5+
tags:
6+
- 数组
57
---
68

79
<!-- problem:start -->

solution/3300-3399/3386.Button with Longest Push Time/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/3300-3399/3386.Button%20with%20Longest%20Push%20Time/README_EN.md
5+
tags:
6+
- Array
57
---
68

79
<!-- problem:start -->

solution/3300-3399/3387.Maximize Amount After Two Days of Conversions/README.md

Lines changed: 7 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/3300-3399/3387.Maximize%20Amount%20After%20Two%20Days%20of%20Conversions/README.md
5+
tags:
6+
- 深度优先搜索
7+
- 广度优先搜索
8+
-
9+
- 数组
10+
- 字符串
511
---
612

713
<!-- problem:start -->
@@ -103,6 +109,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/3300-3399/3387.Ma
103109
<li><code>rates2.length == m</code></li>
104110
<li><code>1.0 &lt;= rates1[i], rates2[i] &lt;= 10.0</code></li>
105111
<li>输入保证两个转换图在各自的天数中没有矛盾或循环。</li>
112+
<li>输入保证输出&nbsp;<strong>最大</strong>&nbsp;为&nbsp;<code>5 * 10<sup>10</sup></code>。</li>
106113
</ul>
107114

108115
<!-- description:end -->

0 commit comments

Comments
 (0)