Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 54c4475

Browse files
yanglbmeidoocs
andauthored
chore: update lc problems (doocs#1712)
* chore: update lc problems * chore: optimised images with calibre/image-actions --------- Co-authored-by: Doocs Bot <doocs-bot@outlook.com>
1 parent 435f106 commit 54c4475

File tree

189 files changed

+1238
-1094
lines changed

Some content is hidden

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

189 files changed

+1238
-1094
lines changed

‎solution/0000-0099/0026.Remove Duplicates from Sorted Array/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<!-- 这里写题目描述 -->
88

9-
<p>给你一个 <strong>升序排列</strong> 的数组 <code>nums</code> ,请你<strong><a href="http://baike.baidu.com/item/%E5%8E%9F%E5%9C%B0%E7%AE%97%E6%B3%95" target="_blank"> 原地</a></strong> 删除重复出现的元素,使每个元素 <strong>只出现一次</strong> ,返回删除后数组的新长度。元素的 <strong>相对顺序</strong> 应该保持 <strong>一致</strong> 。然后返回 <code>nums</code> 中唯一元素的个数。</p>
9+
<p>给你一个 <strong>非严格递增排列</strong> 的数组 <code>nums</code> ,请你<strong><a href="http://baike.baidu.com/item/%E5%8E%9F%E5%9C%B0%E7%AE%97%E6%B3%95" target="_blank"> 原地</a></strong> 删除重复出现的元素,使每个元素 <strong>只出现一次</strong> ,返回删除后数组的新长度。元素的 <strong>相对顺序</strong> 应该保持 <strong>一致</strong> 。然后返回 <code>nums</code> 中唯一元素的个数。</p>
1010

1111
<p>考虑 <code>nums</code> 的唯一元素的数量为 <code>k</code> ,你需要做以下事情确保你的题解可以被通过:</p>
1212

@@ -57,7 +57,7 @@ for (int i = 0; i &lt; k; i++) {
5757
<ul>
5858
<li><code>1 &lt;= nums.length &lt;= 3 * 10<sup>4</sup></code></li>
5959
<li><code>-10<sup>4</sup> &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
60-
<li><code>nums</code> 已按 <strong>升序</strong>排列</li>
60+
<li><code>nums</code> 已按 <strong>非严格递增</strong>&nbsp;排列</li>
6161
</ul>
6262

6363
## 解法

‎solution/0100-0199/0138.Copy List with Random Pointer/README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [138. 复制带随机指针的链表](https://leetcode.cn/problems/copy-list-with-random-pointer)
1+
# [138. 随机链表的复制](https://leetcode.cn/problems/copy-list-with-random-pointer)
22

33
[English Version](/solution/0100-0199/0138.Copy%20List%20with%20Random%20Pointer/README_EN.md)
44

@@ -62,6 +62,10 @@
6262
<li><code>Node.random</code>&nbsp;为&nbsp;<code>null</code> 或指向链表中的节点。</li>
6363
</ul>
6464

65+
<p>注意:本题与主站 138 题相同:<a href="https://leetcode.cn/problems/copy-list-with-random-pointer/" rel="noopener noreferrer" target="_blank">https://leetcode.cn/problems/copy-list-with-random-pointer/</a></p>
66+
67+
<p>&nbsp;</p>
68+
6569
## 解法
6670

6771
<!-- 这里可写通用的实现逻辑 -->

‎solution/0200-0299/0238.Product of Array Except Self/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<p>题目数据 <strong>保证</strong> 数组&nbsp;<code>nums</code>之中任意元素的全部前缀元素和后缀的乘积都在&nbsp; <strong>32 位</strong> 整数范围内。</p>
1212

13-
<p>请<strong>不要使用除法,</strong>且在&nbsp;<code>O(<em>n</em>)</code> 时间复杂度内完成此题。</p>
13+
<p>请&nbsp;<strong>不要使用除法,</strong>且在&nbsp;<code>O(<em>n</em>)</code> 时间复杂度内完成此题。</p>
1414

1515
<p>&nbsp;</p>
1616

@@ -40,7 +40,7 @@
4040

4141
<p>&nbsp;</p>
4242

43-
<p><strong>进阶:</strong>你可以在 <code>O(1)</code>&nbsp;的额外空间复杂度内完成这个题目吗?( 出于对空间复杂度分析的目的,输出数组<strong>不被视为</strong>额外空间。)</p>
43+
<p><strong>进阶:</strong>你可以在 <code>O(1)</code>&nbsp;的额外空间复杂度内完成这个题目吗?( 出于对空间复杂度分析的目的,输出数组&nbsp;<strong>不被视为&nbsp;</strong>额外空间。)</p>
4444

4545
## 解法
4646

‎solution/0200-0299/0238.Product of Array Except Self/README_EN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</ul>
2929

3030
<p>&nbsp;</p>
31-
<p><strong>Follow up:</strong>&nbsp;Can you solve the problem in <code>O(1)&nbsp;</code>extra&nbsp;space complexity? (The output array <strong>does not</strong> count as extra space for space complexity analysis.)</p>
31+
<p><strong>Follow up:</strong>&nbsp;Can you solve the problem in <code>O(1)</code>&nbsp;extra&nbsp;space complexity? (The output array <strong>does not</strong> count as extra space for space complexity analysis.)</p>
3232

3333
## Solutions
3434

‎solution/0400-0499/0460.LFU Cache/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<ul>
1414
<li><code>LFUCache(int capacity)</code> - 用数据结构的容量&nbsp;<code>capacity</code> 初始化对象</li>
1515
<li><code>int get(int key)</code>&nbsp;- 如果键&nbsp;<code>key</code> 存在于缓存中,则获取键的值,否则返回 <code>-1</code> 。</li>
16-
<li><code>void put(int key, int value)</code>&nbsp;- 如果键&nbsp;<code>key</code> 已存在,则变更其值;如果键不存在,请插入键值对。当缓存达到其容量&nbsp;<code>capacity</code> 时,则应该在插入新项之前,移除最不经常使用的项。在此问题中,当存在平局(即两个或更多个键具有相同使用频率)时,应该去除 <strong>最近最久未使用</strong> 的键。</li>
16+
<li><code>void put(int key, int value)</code>&nbsp;- 如果键&nbsp;<code>key</code> 已存在,则变更其值;如果键不存在,请插入键值对。当缓存达到其容量&nbsp;<code>capacity</code> 时,则应该在插入新项之前,移除最不经常使用的项。在此问题中,当存在平局(即两个或更多个键具有相同使用频率)时,应该去除 <strong>最久未使用</strong> 的键。</li>
1717
</ul>
1818

1919
<p>为了确定最不常使用的键,可以为缓存中的每个键维护一个 <strong>使用计数器</strong> 。使用计数最小的键是最久未使用的键。</p>

‎solution/0400-0499/0475.Heaters/README.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@
66

77
<!-- 这里写题目描述 -->
88

9-
<p>冬季已经来临。你的任务是设计一个有固定加热半径的供暖器向所有房屋供暖。</p>
9+
<p>冬季已经来临。&nbsp;你的任务是设计一个有固定加热半径的供暖器向所有房屋供暖。</p>
1010

1111
<p>在加热器的加热半径范围内的每个房屋都可以获得供暖。</p>
1212

13-
<p>现在,给出位于一条水平线上的房屋<code>houses</code> 和供暖器<code>heaters</code> 的位置,请你找出并返回可以覆盖所有房屋的最小加热半径。</p>
13+
<p>现在,给出位于一条水平线上的房屋&nbsp;<code>houses</code> 和供暖器&nbsp;<code>heaters</code> 的位置,请你找出并返回可以覆盖所有房屋的最小加热半径。</p>
1414

15-
<p><strong>说明</strong>:所有供暖器都遵循你的半径标准,加热的半径也一样。</p>
15+
<p><b>注意</b>:所有供暖器 <code>heaters</code> 都遵循你的半径标准,加热的半径也一样。</p>
1616

17-
<p></p>
17+
<p>&nbsp;</p>
1818

1919
<p><strong>示例 1:</strong></p>
2020

2121
<pre>
2222
<strong>输入:</strong> houses = [1,2,3], heaters = [2]
2323
<strong>输出:</strong> 1
24-
<strong>解释:</strong> 仅在位置2上有一个供暖器。如果我们将加热半径设为1,那么所有房屋就都能得到供暖。
24+
<strong>解释:</strong> 仅在位置 2 上有一个供暖器。如果我们将加热半径设为 1,那么所有房屋就都能得到供暖。
2525
</pre>
2626

2727
<p><strong>示例 2:</strong></p>
2828

2929
<pre>
3030
<strong>输入:</strong> houses = [1,2,3,4], heaters = [1,4]
3131
<strong>输出:</strong> 1
32-
<strong>解释:</strong> 在位置1, 4上有两个供暖器。我们需要将加热半径设为1,这样所有房屋就都能得到供暖。
32+
<strong>解释:</strong> 在位置 1, 4 上有两个供暖器。我们需要将加热半径设为 1,这样所有房屋就都能得到供暖。
3333
</pre>
3434

3535
<p><strong>示例 3:</strong></p>
@@ -39,13 +39,13 @@
3939
<strong>输出:</strong>3
4040
</pre>
4141

42-
<p></p>
42+
<p>&nbsp;</p>
4343

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

4646
<ul>
47-
<li><code>1 <= houses.length, heaters.length <= 3 * 10<sup>4</sup></code></li>
48-
<li><code>1 <= houses[i], heaters[i] <= 10<sup>9</sup></code></li>
47+
<li><code>1 &lt;= houses.length, heaters.length &lt;= 3 * 10<sup>4</sup></code></li>
48+
<li><code>1 &lt;= houses[i], heaters[i] &lt;= 10<sup>9</sup></code></li>
4949
</ul>
5050

5151
## 解法

‎solution/0400-0499/0475.Heaters/README_EN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<pre>
2727
<strong>Input:</strong> houses = [1,2,3,4], heaters = [1,4]
2828
<strong>Output:</strong> 1
29-
<strong>Explanation:</strong> The two heater was placed in the position 1 and 4. We need to use radius 1 standard, then all the houses can be warmed.
29+
<strong>Explanation:</strong> The two heaters were placed at positions 1 and 4. We need to use a radius 1 standard, then all the houses can be warmed.
3030
</pre>
3131

3232
<p><strong class="example">Example 3:</strong></p>

‎solution/0500-0599/0533.Lonely Pixel II/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<p>&nbsp;</p>
1919

2020
<p><strong>示例 1:</strong></p>
21-
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0533.Lonely%20Pixel%20II/images/pixel2-1-grid.jpg" style="width: 493px; height: 333px;" />
21+
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0533.Lonely%20Pixel%20II/images/1694957797-UWXAxl-image.png" style="width: 493px; height: 333px;" />
2222
<pre>
2323
<strong>输入:</strong>picture = [["W","B","W","B","B","W"],["W","B","W","B","B","W"],["W","B","W","B","B","W"],["W","W","B","W","B","W"]], target = 3
2424
<strong>输出:</strong>6
@@ -29,7 +29,7 @@
2929
</pre>
3030

3131
<p><strong>示例 2:</strong></p>
32-
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0533.Lonely%20Pixel%20II/images/pixel2-2-grid.jpg" style="width: 253px; height: 253px;" />
32+
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0500-0599/0533.Lonely%20Pixel%20II/images/1694957806-FyCCMF-image.png" style="width: 253px; height: 253px;" />
3333
<pre>
3434
<strong>输入:</strong>picture = [["W","W","B"],["W","W","B"],["W","W","B"]], target = 1
3535
<strong>输出:</strong>0
30.2 KB
Loading[フレーム]
11.2 KB
Loading[フレーム]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /