Skip to content

Commit a7f9b88

Browse files
committed
chore: update lc problems
1 parent 3efa26a commit a7f9b88

File tree

50 files changed

+1233
-396
lines changed

Some content is hidden

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

50 files changed

+1233
-396
lines changed

solution/0000-0099/0049.Group Anagrams/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<p>给你一个字符串数组,请你将 <strong>字母异位词</strong> 组合在一起。可以按任意顺序返回结果列表。</p>
1010

11-
<p><strong>字母异位词</strong> 是由重新排列源单词的字母得到的一个新单词,所有源单词中的字母通常恰好只用一次。</p>
11+
<p><strong>字母异位词</strong> 是由重新排列源单词的所有字母得到的一个新单词。</p>
1212

1313
<p>&nbsp;</p>
1414

solution/0100-0199/0134.Gas Station/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<p>你有一辆油箱容量无限的的汽车,从第<em> </em><code>i</code><em> </em>个加油站开往第<em> </em><code>i+1</code><em>&nbsp;</em>个加油站需要消耗汽油&nbsp;<code>cost[i]</code><em>&nbsp;</em>升。你从其中的一个加油站出发,开始时油箱为空。</p>
1212

13-
<p>给定两个整数数组 <code>gas</code> 和 <code>cost</code> ,如果你可以绕环路行驶一周,则返回出发时加油站的编号,否则返回 <code>-1</code> 。如果存在解,则 <strong>保证</strong> 它是 <strong>唯一</strong> 的。</p>
13+
<p>给定两个整数数组 <code>gas</code> 和 <code>cost</code> ,如果你可以按顺序绕环路行驶一周,则返回出发时加油站的编号,否则返回 <code>-1</code> 。如果存在解,则 <strong>保证</strong> 它是 <strong>唯一</strong> 的。</p>
1414

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

solution/0200-0299/0220.Contains Duplicate III/README.md

+28-18
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,49 @@
66

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

9-
<p>给你一个整数数组 <code>nums</code> 和两个整数 <code>k</code> 和 <code>t</code> 。请你判断是否存在 <b>两个不同下标</b> <code>i</code> 和 <code>j</code>,使得 <code>abs(nums[i] - nums[j]) <= t</code> ,同时又满足 <code>abs(i - j) <= k</code><em> </em>。</p>
9+
<p>给你一个整数数组 <code>nums</code> 和两个整数 <code>indexDiff</code> 和 <code>valueDiff</code> 。</p>
1010

11-
<p>如果存在则返回 <code>true</code>,不存在返回 <code>false</code></p>
11+
<p>找出满足下述条件的下标对 <code>(i, j)</code></p>
1212

13-
<p> </p>
13+
<ul>
14+
<li><code>i != j</code>,</li>
15+
<li><code>abs(i - j) &lt;= indexDiff</code></li>
16+
<li><code>abs(nums[i] - nums[j]) &lt;= valueDiff</code></li>
17+
</ul>
1418

15-
<p><strong>示例 1:</strong></p>
19+
<p>如果存在,返回 <code>true</code><em> ;</em>否则,返回<em> </em><code>false</code><em> </em>。</p>
1620

17-
<pre>
18-
<strong>输入:</strong>nums = [1,2,3,1], k<em> </em>= 3, t = 0
19-
<strong>输出:</strong>true</pre>
21+
<p>&nbsp;</p>
2022

21-
<p><strong>示例 2:</strong></p>
23+
<p><strong class="example">示例 1:</strong></p>
2224

2325
<pre>
24-
<strong>输入:</strong>nums = [1,0,1,1], k<em> </em>=<em> </em>1, t = 2
25-
<strong>输出:</strong>true</pre>
26+
<strong>输入:</strong>nums = [1,2,3,1], indexDiff = 3, valueDiff = 0
27+
<strong>输出:</strong>true
28+
<strong>解释:</strong>可以找出 (i, j) = (0, 3) 。
29+
满足下述 3 个条件:
30+
i != j --&gt; 0 != 3
31+
abs(i - j) &lt;= indexDiff --&gt; abs(0 - 3) &lt;= 3
32+
abs(nums[i] - nums[j]) &lt;= valueDiff --&gt; abs(1 - 1) &lt;= 0
33+
</pre>
2634

27-
<p><strong>示例 3:</strong></p>
35+
<p><strong class="example">示例 2:</strong></p>
2836

2937
<pre>
30-
<strong>输入:</strong>nums = [1,5,9,1,5,9], k = 2, t = 3
31-
<strong>输出:</strong>false</pre>
38+
<strong>输入:</strong>nums = [1,5,9,1,5,9], indexDiff = 2, valueDiff = 3
39+
<strong>输出:</strong>false
40+
<strong>解释:</strong>尝试所有可能的下标对 (i, j) ,均无法满足这 3 个条件,因此返回 false 。
41+
</pre>
3242

33-
<p> </p>
43+
<p>&nbsp;</p>
3444

3545
<p><strong>提示:</strong></p>
3646

3747
<ul>
38-
<li><code>0 <= nums.length <= 2 * 10<sup>4</sup></code></li>
39-
<li><code>-2<sup>31</sup> <= nums[i] <= 2<sup>31</sup> - 1</code></li>
40-
<li><code>0 <= k <= 10<sup>4</sup></code></li>
41-
<li><code>0 <= t <= 2<sup>31</sup> - 1</code></li>
48+
<li><code>2 &lt;= nums.length &lt;= 10<sup>5</sup></code></li>
49+
<li><code>-10<sup>9</sup> &lt;= nums[i] &lt;= 10<sup>9</sup></code></li>
50+
<li><code>1 &lt;= indexDiff &lt;= nums.length</code></li>
51+
<li><code>0 &lt;= valueDiff &lt;= 10<sup>9</sup></code></li>
4252
</ul>
4353

4454
## 解法

solution/0200-0299/0291.Word Pattern II/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<p>给你一种规律&nbsp;<code>pattern</code>&nbsp;和一个字符串&nbsp;<code>s</code>,请你判断&nbsp;<code>s</code>&nbsp;是否和<em>&nbsp;</em><code>pattern</code>&nbsp;的规律<strong>相匹配</strong>。</p>
1010

11-
<p>如果存在单个字符到字符串的 <strong>双射映射</strong> ,那么字符串<meta charset="UTF-8" />&nbsp;<code>s</code>&nbsp;匹配<meta charset="UTF-8" />&nbsp;<code>pattern</code>&nbsp;,即:如果<meta charset="UTF-8" /><code>pattern</code>&nbsp;中的每个字符都被它映射到的字符串替换,那么最终的字符串则为 <code>s</code> 。<strong>双射</strong> 意味着映射双方一一对应,不会存在两个字符映射到同一个字符串,也不会存在一个字符分别映射到两个不同的字符串。</p>
11+
<p>如果存在单个字符到 <strong>非空</strong> 字符串的 <strong>双射映射</strong> ,那么字符串<meta charset="UTF-8" />&nbsp;<code>s</code>&nbsp;匹配<meta charset="UTF-8" />&nbsp;<code>pattern</code>&nbsp;,即:如果&nbsp;<meta charset="UTF-8" /><code>pattern</code>&nbsp;中的每个字符都被它映射到的字符串替换,那么最终的字符串则为 <code>s</code> 。<strong>双射</strong> 意味着映射双方一一对应,不会存在两个字符映射到同一个字符串,也不会存在一个字符分别映射到两个不同的字符串。</p>
1212

1313
<p>&nbsp;</p>
1414

solution/0200-0299/0291.Word Pattern II/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<p>Given a <code>pattern</code> and a string <code>s</code>, return <code>true</code><em> if </em><code>s</code><em> <strong>matches</strong> the </em><code>pattern</code><em>.</em></p>
88

9-
<p>A string <code>s</code> <b>matches</b> a <code>pattern</code> if there is some <strong>bijective mapping</strong> of single characters to strings such that if each character in <code>pattern</code> is replaced by the string it maps to, then the resulting string is <code>s</code>. A <strong>bijective mapping</strong> means that no two characters map to the same string, and no character maps to two different strings.</p>
9+
<p>A string <code>s</code> <b>matches</b> a <code>pattern</code> if there is some <strong>bijective mapping</strong> of single characters to <strong>non-empty</strong> strings such that if each character in <code>pattern</code> is replaced by the string it maps to, then the resulting string is <code>s</code>. A <strong>bijective mapping</strong> means that no two characters map to the same string, and no character maps to two different strings.</p>
1010

1111
<p>&nbsp;</p>
1212
<p><strong class="example">Example 1:</strong></p>

solution/0800-0899/0846.Hand of Straights/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<p>Alice 手中有一把牌,她想要重新排列这些牌,分成若干组,使每一组的牌数都是 <code>groupSize</code> ,并且由 <code>groupSize</code> 张连续的牌组成。</p>
1010

11-
<p>给你一个整数数组 <code>hand</code> 其中 <code>hand[i]</code> 是写在第 <code>i</code> 张牌,和一个整数 <code>groupSize</code> 。如果她可能重新排列这些牌,返回 <code>true</code> ;否则,返回 <code>false</code> 。</p>
11+
<p>给你一个整数数组 <code>hand</code> 其中 <code>hand[i]</code> 是写在第 <code>i</code> 张牌上的<strong>数值</strong>。如果她可能重新排列这些牌,返回 <code>true</code> ;否则,返回 <code>false</code> 。</p>
1212

1313
<p>&nbsp;</p>
1414

solution/1200-1299/1289.Minimum Falling Path Sum II/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66

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

9-
<p>给你一个&nbsp;<code>n x n</code> 整数矩阵&nbsp;<code>arr</code>&nbsp;,请你返回 <strong>非零偏移下降路径</strong> 数字和的最小值。</p>
9+
<p>给你一个&nbsp;<code>n x n</code> 整数矩阵&nbsp;<code>grid</code>&nbsp;,请你返回 <strong>非零偏移下降路径</strong> 数字和的最小值。</p>
1010

11-
<p><strong>非零偏移下降路径</strong> 定义为:从&nbsp;<code>arr</code> 数组中的每一行选择一个数字,且按顺序选出来的数字中,相邻数字不在原数组的同一列。</p>
11+
<p><strong>非零偏移下降路径</strong> 定义为:从&nbsp;<code>grid</code> 数组中的每一行选择一个数字,且按顺序选出来的数字中,相邻数字不在原数组的同一列。</p>
1212

1313
<p>&nbsp;</p>
1414

15-
<p><strong>示例 1:</strong></p>
15+
<p><strong class="example">示例 1:</strong></p>
1616

1717
<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1200-1299/1289.Minimum%20Falling%20Path%20Sum%20II/images/falling-grid.jpg" style="width: 244px; height: 245px;" /></p>
1818

1919
<pre>
20-
<strong>输入:</strong>arr = [[1,2,3],[4,5,6],[7,8,9]]
20+
<strong>输入:</strong>grid = [[1,2,3],[4,5,6],[7,8,9]]
2121
<strong>输出:</strong>13
2222
<strong>解释:</strong>
2323
所有非零偏移下降路径包括:
@@ -27,7 +27,7 @@
2727
下降路径中数字和最小的是&nbsp;[1,5,7] ,所以答案是&nbsp;13 。
2828
</pre>
2929

30-
<p><strong>示例 2:</strong></p>
30+
<p><strong class="example">示例 2:</strong></p>
3131

3232
<pre>
3333
<strong>输入:</strong>grid = [[7]]

solution/1400-1499/1406.Stone Game III/README.md

+18-23
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,53 @@
66

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

9-
<p>Alice 和 Bob 用几堆石子在做游戏。几堆石子排成一行,每堆石子都对应一个得分,由数组 <code>stoneValue</code> 给出。</p>
9+
<p>Alice 和 Bob 继续他们的石子游戏。几堆石子 <strong>排成一行</strong> ,每堆石子都对应一个得分,由数组 <code>stoneValue</code> 给出。</p>
1010

1111
<p>Alice 和 Bob 轮流取石子,<strong>Alice</strong> 总是先开始。在每个玩家的回合中,该玩家可以拿走剩下石子中的的前 <strong>1、2 或 3 堆石子</strong> 。比赛一直持续到所有石头都被拿走。</p>
1212

13-
<p>每个玩家的最终得分为他所拿到的每堆石子的对应得分之和。每个玩家的初始分数都是 <strong>0</strong> 。比赛的目标是决出最高分,得分最高的选手将会赢得比赛,比赛也可能会出现平局。</p>
13+
<p>每个玩家的最终得分为他所拿到的每堆石子的对应得分之和。每个玩家的初始分数都是 <strong>0</strong> 。</p>
1414

15-
<p>假设 Alice 和 Bob 都采取 <strong>最优策略</strong> 。如果 Alice 赢了就返回 <em>&quot;Alice&quot;</em> <em>,</em>Bob 赢了就返回<em> &quot;Bob&quot;,</em>平局(分数相同)返回 <em>&quot;Tie&quot;</em> 。</p>
15+
<p>比赛的目标是决出最高分,得分最高的选手将会赢得比赛,比赛也可能会出现平局。</p>
16+
17+
<p>假设 Alice 和 Bob 都采取 <strong>最优策略</strong> 。</p>
18+
19+
<p>如果 Alice 赢了就返回 <code>"Alice"</code> <em>,</em>Bob 赢了就返回<em> </em><code>"Bob"</code><em>,</em>分数相同返回 <code>"Tie"</code> 。</p>
1620

1721
<p>&nbsp;</p>
1822

1923
<p><strong>示例 1:</strong></p>
2024

21-
<pre><strong>输入:</strong>values = [1,2,3,7]
22-
<strong>输出:</strong>&quot;Bob&quot;
25+
<pre>
26+
<strong>输入:</strong>values = [1,2,3,7]
27+
<strong>输出:</strong>"Bob"
2328
<strong>解释:</strong>Alice 总是会输,她的最佳选择是拿走前三堆,得分变成 6 。但是 Bob 的得分为 7,Bob 获胜。
2429
</pre>
2530

2631
<p><strong>示例 2:</strong></p>
2732

28-
<pre><strong>输入:</strong>values = [1,2,3,-9]
29-
<strong>输出:</strong>&quot;Alice&quot;
33+
<pre>
34+
<strong>输入:</strong>values = [1,2,3,-9]
35+
<strong>输出:</strong>"Alice"
3036
<strong>解释:</strong>Alice 要想获胜就必须在第一个回合拿走前三堆石子,给 Bob 留下负分。
3137
如果 Alice 只拿走第一堆,那么她的得分为 1,接下来 Bob 拿走第二、三堆,得分为 5 。之后 Alice 只能拿到分数 -9 的石子堆,输掉比赛。
3238
如果 Alice 拿走前两堆,那么她的得分为 3,接下来 Bob 拿走第三堆,得分为 3 。之后 Alice 只能拿到分数 -9 的石子堆,同样会输掉比赛。
3339
注意,他们都应该采取 <strong>最优策略 </strong>,所以在这里 Alice 将选择能够使她获胜的方案。</pre>
3440

3541
<p><strong>示例 3:</strong></p>
3642

37-
<pre><strong>输入:</strong>values = [1,2,3,6]
38-
<strong>输出:</strong>&quot;Tie&quot;
43+
<pre>
44+
<strong>输入:</strong>values = [1,2,3,6]
45+
<strong>输出:</strong>"Tie"
3946
<strong>解释:</strong>Alice 无法赢得比赛。如果她决定选择前三堆,她可以以平局结束比赛,否则她就会输。
4047
</pre>
4148

42-
<p><strong>示例 4:</strong></p>
43-
44-
<pre><strong>输入:</strong>values = [1,2,3,-1,-2,-3,7]
45-
<strong>输出:</strong>&quot;Alice&quot;
46-
</pre>
47-
48-
<p><strong>示例 5:</strong></p>
49-
50-
<pre><strong>输入:</strong>values = [-1,-2,-3]
51-
<strong>输出:</strong>&quot;Tie&quot;
52-
</pre>
53-
5449
<p>&nbsp;</p>
5550

5651
<p><strong>提示:</strong></p>
5752

5853
<ul>
59-
<li><code>1 &lt;= values.length &lt;= 50000</code></li>
60-
<li><code>-1000&nbsp;&lt;= values[i] &lt;= 1000</code></li>
54+
<li><code>1 &lt;= stoneValue.length &lt;= 5 * 10<sup>4</sup></code></li>
55+
<li><code>-1000&nbsp;&lt;= stoneValue[i] &lt;= 1000</code></li>
6156
</ul>
6257

6358
## 解法

solution/1400-1499/1406.Stone Game III/README_EN.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
<p><strong class="example">Example 1:</strong></p>
2121

2222
<pre>
23-
<strong>Input:</strong> values = [1,2,3,7]
23+
<strong>Input:</strong> stoneValue = [1,2,3,7]
2424
<strong>Output:</strong> &quot;Bob&quot;
2525
<strong>Explanation:</strong> Alice will always lose. Her best move will be to take three piles and the score become 6. Now the score of Bob is 7 and Bob wins.
2626
</pre>
2727

2828
<p><strong class="example">Example 2:</strong></p>
2929

3030
<pre>
31-
<strong>Input:</strong> values = [1,2,3,-9]
31+
<strong>Input:</strong> stoneValue = [1,2,3,-9]
3232
<strong>Output:</strong> &quot;Alice&quot;
3333
<strong>Explanation:</strong> Alice must choose all the three piles at the first move to win and leave Bob with negative score.
3434
If Alice chooses one pile her score will be 1 and the next move Bob&#39;s score becomes 5. In the next move, Alice will take the pile with value = -9 and lose.
@@ -39,7 +39,7 @@ Remember that both play optimally so here Alice will choose the scenario that ma
3939
<p><strong class="example">Example 3:</strong></p>
4040

4141
<pre>
42-
<strong>Input:</strong> values = [1,2,3,6]
42+
<strong>Input:</strong> stoneValue = [1,2,3,6]
4343
<strong>Output:</strong> &quot;Tie&quot;
4444
<strong>Explanation:</strong> Alice cannot win this game. She can end the game in a draw if she decided to choose all the first three piles, otherwise she will lose.
4545
</pre>

solution/1800-1899/1826.Faulty Sensor/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66

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

9-
<p>实验室里正在进行一项实验。为了确保数据的准确性,同时使用 <strong>两个</strong> 传感器来采集数据。您将获得2个数组 <code>sensor1</code> and <code>sensor2</code>,其中 <code>sensor1[i]</code> 和 <code>sensor2[i]</code> 分别是两个传感器对<span style="">第 <code>i</code> 个</span>数据点采集到的数据。</p>
9+
<p>实验室里正在进行一项实验。为了确保数据的准确性,同时使用 <strong>两个</strong> 传感器来采集数据。您将获得2个数组 <code>sensor1</code> and <code>sensor2</code>,其中 <code>sensor1[i]</code>&nbsp;&nbsp;<code>sensor2[i]</code>&nbsp;分别是两个传感器对<span style="">第 <code>i</code> 个</span>数据点采集到的数据。</p>
1010

1111
<p>但是,这种类型的传感器有可能存在缺陷,它会导致 <strong>某一个</strong> 数据点采集的数据(掉落值)被丢弃。</p>
1212

1313
<p>数据被丢弃后,所有在其右侧的数据点采集的数据,都会被向左移动一个位置,最后一个数据点采集的数据会被一些随机值替换。可以保证此随机值不等于掉落值。</p>
1414

1515
<ul>
16-
<li>举个例子, 如果正确的数据是 <code>[1,2,<em><strong>3</strong></em>,4,5]</code> , 此时 <code>3</code> 被丢弃了, 传感器会返回 <code>[1,2,4,5,<em><strong>7</strong></em>]</code> (最后的位置可以是任何值, 不仅仅是 <code>7</code>).</li>
16+
<li>举个例子, 如果正确的数据是&nbsp;<code>[1,2,<em><strong>3</strong></em>,4,5]</code>&nbsp;,&nbsp;此时 <code>3</code> 被丢弃了, 传感器会返回&nbsp;<code>[1,2,4,5,<em><strong>7</strong></em>]</code> (最后的位置可以是任何值, 不仅仅是&nbsp;<code>7</code>).</li>
1717
</ul>
1818

1919
<p>可以确定的是,<strong>最多有一个</strong> 传感器有缺陷。请返回这个有缺陷的传感器的编号 (<code>1</code> 或 <code>2</code>)。如果任一传感器 <strong>没有缺陷</strong> ,或者 <strong>无法</strong> 确定有缺陷的传感器,则返回 <code>-1</code> 。</p>
2020

21-
<p> </p>
21+
<p>&nbsp;</p>
2222

2323
<p><strong>示例 1:</strong></p>
2424

@@ -33,7 +33,7 @@
3333
<pre>
3434
<strong>输入:</strong>sensor1 = [2,2,2,2,2], sensor2 = [2,2,2,2,5]
3535
<strong>输出:</strong>-1
36-
<strong>解释:</strong>无法判定拿个传感器是有缺陷的
36+
<strong>解释:</strong>无法判定哪个传感器是有缺陷的
3737
假设任一传感器丢弃的数据是最后一位,那么,另一个传感器就能给出与之对应的输出。
3838
</pre>
3939

@@ -46,14 +46,14 @@
4646
传感器 1 对第四个数据点的采集数据,被传感器2丢失了, 传感器 2 返回的最后一个数据被替换为 7 。
4747
</pre>
4848

49-
<p> </p>
49+
<p>&nbsp;</p>
5050

5151
<p><strong>提示:</strong></p>
5252

5353
<ul>
5454
<li><code>sensor1.length == sensor2.length</code></li>
55-
<li><code>1 <= sensor1.length <= 100</code></li>
56-
<li><code>1 <= sensor1[i], sensor2[i] <= 100</code></li>
55+
<li><code>1 &lt;= sensor1.length &lt;= 100</code></li>
56+
<li><code>1 &lt;= sensor1[i], sensor2[i] &lt;= 100</code></li>
5757
</ul>
5858

5959
## 解法

solution/2500-2599/2503.Maximum Number of Points From Grid Queries/README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<p>给你一个大小为 <code>m x n</code> 的整数矩阵 <code>grid</code> 和一个大小为 <code>k</code> 的数组 <code>queries</code> 。</p>
1010

11-
<p>找出一个大小为 <code>k</code> 的数组 <code>answer</code> ,且满足对于每个整数 <code>queres[i]</code> ,你从矩阵 <strong>左上角</strong> 单元格开始,重复以下过程:</p>
11+
<p>找出一个大小为 <code>k</code> 的数组 <code>answer</code> ,且满足对于每个整数 <code>queries[i]</code> ,你从矩阵 <strong>左上角</strong> 单元格开始,重复以下过程:</p>
1212

1313
<ul>
1414
<li>如果 <code>queries[i]</code> <strong>严格</strong> 大于你当前所处位置单元格,如果该单元格是第一次访问,则获得 1 分,并且你可以移动到所有 <code>4</code> 个方向(上、下、左、右)上任一 <strong>相邻</strong> 单元格。</li>
@@ -22,14 +22,16 @@
2222
<p>&nbsp;</p>
2323

2424
<p><strong>示例 1:</strong></p>
25-
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/2500-2599/2503.Maximum%20Number%20of%20Points%20From%20Grid%20Queries/images/yetgriddrawio.png" style="width: 571px; height: 151px;">
26-
<pre><strong>输入:</strong>grid = [[1,2,3],[2,5,7],[3,5,1]], queries = [5,6,2]
25+
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/2500-2599/2503.Maximum%20Number%20of%20Points%20From%20Grid%20Queries/images/yetgriddrawio.png" style="width: 571px; height: 151px;" />
26+
<pre>
27+
<strong>输入:</strong>grid = [[1,2,3],[2,5,7],[3,5,1]], queries = [5,6,2]
2728
<strong>输出:</strong>[5,8,1]
2829
<strong>解释:</strong>上图展示了每个查询中访问并获得分数的单元格。</pre>
2930

3031
<p><strong>示例 2:</strong></p>
31-
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/2500-2599/2503.Maximum%20Number%20of%20Points%20From%20Grid%20Queries/images/yetgriddrawio-2.png">
32-
<pre><strong>输入:</strong>grid = [[5,2,1],[1,1,2]], queries = [3]
32+
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/2500-2599/2503.Maximum%20Number%20of%20Points%20From%20Grid%20Queries/images/yetgriddrawio-2.png" />
33+
<pre>
34+
<strong>输入:</strong>grid = [[5,2,1],[1,1,2]], queries = [3]
3335
<strong>输出:</strong>[0]
3436
<strong>解释:</strong>无法获得分数,因为左上角单元格的值大于等于 3 。
3537
</pre>

solution/2500-2599/2517.Maximum Tastiness of Candy Basket/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@
4747
<p><strong>提示:</strong></p>
4848

4949
<ul>
50-
<li><code>1 &lt;= price.length &lt;= 10<sup>5</sup></code></li>
50+
<li><code>2 &lt;= k &lt;= price.length &lt;= 10<sup>5</sup></code></li>
5151
<li><code>1 &lt;= price[i] &lt;= 10<sup>9</sup></code></li>
52-
<li><code>2 &lt;= k &lt;= price.length</code></li>
5352
</ul>
5453

5554
## 解法

0 commit comments

Comments
 (0)