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 ba6db03

Browse files
feat: update lc problems (doocs#2366)
1 parent b4ec29a commit ba6db03

File tree

49 files changed

+818
-220
lines changed

Some content is hidden

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

49 files changed

+818
-220
lines changed

‎solution/0300-0399/0373.Find K Pairs with Smallest Sums/README.md‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@
3434
  [1,1],[1,1],[1,2],[2,1],[1,2],[2,2],[1,3],[1,3],[2,3]
3535
</pre>
3636

37-
<p><strong class="example">示例 3:</strong></p>
38-
39-
<pre>
40-
<strong>输入: </strong>nums1 = [1,2], nums2 = [3], k = 3
41-
<strong>输出:</strong> [1,3],[2,3]
42-
<strong>解释: </strong>也可能序列中所有的数对都被返回:[1,3],[2,3]
43-
</pre>
44-
4537
<p>&nbsp;</p>
4638

4739
<p><strong>提示:</strong></p>

‎solution/0600-0699/0629.K Inverse Pairs Array/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>逆序对的定义如下:对于数组 <code>nums</code> 的第 <code>i</code> 个和第 <code>j</code> 个元素,如果满足 <code>0 &lt;= i &lt; j &lt; nums.length</code> 且&nbsp;<code>nums[i] &gt; nums[j]</code>,则其为一个逆序对;否则不是。</p>
11+
<p>对于一个整数数组&nbsp;<code>nums</code>,<strong>逆序对</strong>是一对满足 <code>0 &lt;= i &lt; j &lt; nums.length</code> 且&nbsp;<code>nums[i] &gt; nums[j]</code>的整数对&nbsp;<code>[i, j]</code>&nbsp;。</p>
1212

1313
<p>给你两个整数&nbsp;<code>n</code>&nbsp;&nbsp;<code>k</code>,找出所有包含从&nbsp;<code>1</code>&nbsp;&nbsp;<code>n</code>&nbsp;的数字,且恰好拥有&nbsp;<code>k</code>&nbsp;个 <strong>逆序对</strong> 的不同的数组的个数。由于答案可能很大,只需要返回对 <code>10<sup>9</sup>&nbsp;+ 7</code> 取余的结果。</p>
1414

‎solution/0700-0799/0786.K-th Smallest Prime Fraction/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [786. 第 K 个最小的素数分数](https://leetcode.cn/problems/k-th-smallest-prime-fraction)
1+
# [786. 第 K 个最小的质数分数](https://leetcode.cn/problems/k-th-smallest-prime-fraction)
22

33
[English Version](/solution/0700-0799/0786.K-th%20Smallest%20Prime%20Fraction/README_EN.md)
44

@@ -8,7 +8,7 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>给你一个按递增顺序排序的数组 <code>arr</code> 和一个整数 <code>k</code> 。数组 <code>arr</code> 由 <code>1</code> 和若干 <strong>素数</strong>&nbsp; 组成,且其中所有整数互不相同。</p>
11+
<p>给你一个按递增顺序排序的数组 <code>arr</code> 和一个整数 <code>k</code> 。数组 <code>arr</code> 由 <code>1</code> 和若干 <strong>质数</strong> 组成,且其中所有整数互不相同。</p>
1212

1313
<p>对于每对满足 <code>0 &lt;= i &lt; j &lt; arr.length</code> 的 <code>i</code> 和 <code>j</code> ,可以得到分数 <code>arr[i] / arr[j]</code> 。</p>
1414

@@ -40,7 +40,7 @@
4040
<li><code>2 &lt;= arr.length &lt;= 1000</code></li>
4141
<li><code>1 &lt;= arr[i] &lt;= 3 * 10<sup>4</sup></code></li>
4242
<li><code>arr[0] == 1</code></li>
43-
<li><code>arr[i]</code> 是一个 <strong>素数</strong> ,<code>i &gt; 0</code></li>
43+
<li><code>arr[i]</code> 是一个 <strong>质数</strong> ,<code>i &gt; 0</code></li>
4444
<li><code>arr</code> 中的所有数字 <strong>互不相同</strong> ,且按 <strong>严格递增</strong> 排序</li>
4545
<li><code>1 &lt;= k &lt;= arr.length * (arr.length - 1) / 2</code></li>
4646
</ul>

‎solution/0800-0899/0866.Prime Palindrome/README.md‎

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [866. 回文素数](https://leetcode.cn/problems/prime-palindrome)
1+
# [866. 回文质数](https://leetcode.cn/problems/prime-palindrome)
22

33
[English Version](/solution/0800-0899/0866.Prime%20Palindrome/README_EN.md)
44

@@ -8,48 +8,54 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>求出大于或等于&nbsp;<code>N</code>&nbsp;的最小回文素数。</p>
11+
<p>给你一个整数 <code>n</code> ,返回大于或等于 <code>n</code> 的最小<stron>回文质数</stron>。</p>
12+
<!-- 一个整数是素数的定义,以及1不是素数的说明 -->
1213

13-
<p>回顾一下,如果一个数大于 1,且其因数只有 1 和它自身,那么这个数是<em>素数</em>。</p>
14+
<p>一个整数如果恰好有两个除数:<code>1</code> 和它本身,那么它是 <strong>质数</strong> 。注意,<code>1</code> 不是质数。</p>
1415

15-
<p>例如,2,3,5,7,11 以及&nbsp;13 是素数。</p>
16+
<ul>
17+
<li>例如,<code>2</code>、<code>3</code>、<code>5</code>、<code>7</code>、<code>11</code> 和 <code>13</code> 都是质数。</li>
18+
</ul>
19+
20+
<p>一个整数如果从左向右读和从右向左读是相同的,那么它是<strong> 回文数 </strong>。</p>
1621

17-
<p>回顾一下,如果一个数从左往右读与从右往左读是一样的,那么这个数是<em>回文数。</em></p>
22+
<ul>
23+
<li>例如,<code>101</code> 和 <code>12321</code> 都是回文数。</li>
24+
</ul>
1825

19-
<p>例如,12321 是回文数。</p>
26+
<p>测试用例保证答案总是存在,并且在 <code>[2, 2 * 10<sup>8</sup>]</code> 范围内。</p>
2027

2128
<p>&nbsp;</p>
2229

23-
<p><strong>示例 1:</strong></p>
30+
<p><strongclass="example">示例 1:</strong></p>
2431

25-
<pre><strong>输入:</strong>6
32+
<pre>
33+
<strong>输入:</strong>n = 6
2634
<strong>输出:</strong>7
2735
</pre>
2836

29-
<p><strong>示例&nbsp;2:</strong></p>
37+
<p><strongclass="example">示例2:</strong></p>
3038

31-
<pre><strong>输入:</strong>8
39+
<pre>
40+
<strong>输入:</strong>n = 8
3241
<strong>输出:</strong>11
3342
</pre>
3443

35-
<p><strong>示例&nbsp;3:</strong></p>
44+
<p><strongclass="example">示例3:</strong></p>
3645

37-
<pre><strong>输入:</strong>13
38-
<strong>输出:</strong>101</pre>
46+
<pre>
47+
<strong>输入:</strong>n = 13
48+
<strong>输出:</strong>101
49+
</pre>
3950

4051
<p>&nbsp;</p>
4152

4253
<p><strong>提示:</strong></p>
4354

4455
<ul>
45-
<li><code>1 &lt;= N &lt;= 10^8</code></li>
46-
<li>答案肯定存在,且小于&nbsp;<code>2 * 10^8</code>。</li>
56+
<li><code>1 &lt;= n &lt;= 10<sup>8</sup></code></li>
4757
</ul>
4858

49-
<p>&nbsp;</p>
50-
51-
<p>&nbsp;</p>
52-
5359
## 解法
5460

5561
### 方法一

‎solution/0900-0999/0913.Cat and Mouse/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
</ul>
3636
&nbsp;
3737

38-
<p><strong>示例 1:</strong></p>
38+
<p><strongclass="example">示例 1:</strong></p>
3939
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0913.Cat%20and%20Mouse/images/cat1.jpg" style="width: 300px; height: 300px;" />
4040
<pre>
4141
<strong>输入:</strong>graph = [[2,5],[3],[0,4,5],[1,4,5],[2,3],[0,2,3]]
4242
<strong>输出:</strong>0
4343
</pre>
4444

45-
<p><strong>示例 2:</strong></p>
45+
<p><strongclass="example">示例 2:</strong></p>
4646
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0900-0999/0913.Cat%20and%20Mouse/images/cat2.jpg" style="width: 200px; height: 200px;" />
4747
<pre>
4848
<strong>输入:</strong>graph = [[1,3],[0],[3],[0,2]]

‎solution/0900-0999/0913.Cat and Mouse/README_EN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<p>During each player&#39;s turn, they <strong>must</strong> travel along one&nbsp;edge of the graph that meets where they are.&nbsp; For example, if the Mouse is at node 1, it <strong>must</strong> travel to any node in <code>graph[1]</code>.</p>
1616

17-
<p>Additionally, it is not allowed for the Cat to travel to the Hole (node 0.)</p>
17+
<p>Additionally, it is not allowed for the Cat to travel to the Hole (node <code>0</code>).</p>
1818

1919
<p>Then, the game can end in three&nbsp;ways:</p>
2020

‎solution/1000-1099/1071.Greatest Common Divisor of Strings/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>对于字符串&nbsp;<code>s</code> 和&nbsp;<code>t</code>,只有在&nbsp;<code>s = t + ... + t</code>(<code>t</code> 自身连接 1 次或多次)时,我们才认定&nbsp;"<code>t</code> 能除尽 <code>s</code>"。</p>
11+
<p>对于字符串&nbsp;<code>s</code> 和&nbsp;<code>t</code>,只有在&nbsp;<code>s = t + t + t + ... + t + t</code>(<code>t</code> 自身连接 1 次或多次)时,我们才认定&nbsp;"<code>t</code> 能除尽 <code>s</code>"。</p>
1212

1313
<p>给定两个字符串&nbsp;<code>str1</code>&nbsp;&nbsp;<code>str2</code>&nbsp;。返回 <em>最长字符串&nbsp;<code>x</code>,要求满足&nbsp;<code>x</code> 能除尽 <code>str1</code> 且 <code>x</code> 能除尽 <code>str2</code></em> 。</p>
1414

‎solution/1000-1099/1074.Number of Submatrices That Sum to Target/README.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
<!-- 这里写题目描述 -->
1010

11-
<p>给出矩阵<code>matrix</code>和目标值<code>target</code>,返回元素总和等于目标值的非空子矩阵的数量。</p>
11+
<p>给出矩阵&nbsp;<code>matrix</code>&nbsp;和目标值&nbsp;<code>target</code>,返回元素总和等于目标值的非空子矩阵的数量。</p>
1212

13-
<p>子矩阵<code>x1, y1, x2, y2</code>是满足 <code>x1 <= x <= x2</code><code>y1 <= y <= y2</code>的所有单元<code>matrix[x][y]</code>的集合。</p>
13+
<p>子矩阵&nbsp;<code>x1, y1, x2, y2</code>&nbsp;是满足 <code>x1 &lt;= x &lt;= x2</code>&nbsp;&nbsp;<code>y1 &lt;= y &lt;= y2</code>&nbsp;的所有单元&nbsp;<code>matrix[x][y]</code>&nbsp;的集合。</p>
1414

15-
<p>如果<code>(x1, y1, x2, y2)</code> 和<code>(x1', y1', x2', y2')</code>两个子矩阵中部分坐标不同(如:<code>x1 != x1'</code>),那么这两个子矩阵也不同。</p>
15+
<p>如果&nbsp;<code>(x1, y1, x2, y2)</code> 和&nbsp;<code>(x1', y1', x2', y2')</code>&nbsp;两个子矩阵中部分坐标不同(如:<code>x1 != x1'</code>),那么这两个子矩阵也不同。</p>
1616

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

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

@@ -41,15 +41,15 @@
4141
<strong>输出:</strong>0
4242
</pre>
4343

44-
<p></p>
44+
<p>&nbsp;</p>
4545

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

4848
<ul>
49-
<li><code>1 <= matrix.length <= 100</code></li>
50-
<li><code>1 <= matrix[0].length <= 100</code></li>
51-
<li><code>-1000 <= matrix[i] <= 1000</code></li>
52-
<li><code>-10^8 <= target <= 10^8</code></li>
49+
<li><code>1 &lt;= matrix.length &lt;= 100</code></li>
50+
<li><code>1 &lt;= matrix[0].length &lt;= 100</code></li>
51+
<li><code>-1000 &lt;= matrix[i][j] &lt;= 1000</code></li>
52+
<li><code>-10^8 &lt;= target &lt;= 10^8</code></li>
5353
</ul>
5454

5555
## 解法

‎solution/1100-1199/1159.Market Analysis II/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ item_id 是该表的主键(具有唯一值的列)。
5353

5454
<p>&nbsp;</p>
5555

56-
<p>编写一个解决方案,查找每个用户的加入日期和他们作为买家在 <code>2019</code> 年下的订单数。</p>
56+
<p>编写一个解决方案,为每个用户找出他们出售的第二件商品(按日期)的品牌是否是他们最喜欢的品牌。如果用户售出的商品少于两件,则该用户的结果为否。保证卖家不会在一天内卖出一件以上的商品。</p>
57+
58+
<p>&nbsp;</p>
5759

5860
<p>以 <strong>任意顺序</strong> 返回结果表。</p>
5961

‎solution/1100-1199/1199.Minimum Time to Build Blocks/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[English Version](/solution/1100-1199/1199.Minimum%20Time%20to%20Build%20Blocks/README_EN.md)
44

5-
<!-- tags:贪心,数学,堆(优先队列) -->
5+
<!-- tags:贪心,数组,数学,堆(优先队列) -->
66

77
## 题目描述
88

0 commit comments

Comments
(0)

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