Skip to content

feat: update lc problems #3454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 26 additions & 15 deletions solution/0000-0099/0020.Valid Parentheses/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,37 @@ tags:

<p>&nbsp;</p>

<p><strong>示例 1:</strong></p>
<p><strong class="example">示例 1:</strong></p>

<pre>
<strong>输入:</strong>s = "()"
<strong>输出:</strong>true
</pre>
<div class="example-block">
<p><span class="example-io"><b>输入:</b>s = "()"</span></p>

<p><strong>示例&nbsp;2:</strong></p>
<p><span class="example-io"><b>输出:</b>true</span></p>
</div>

<pre>
<strong>输入:</strong>s = "()[]{}"
<strong>输出:</strong>true
</pre>
<p><strong class="example">示例 2:</strong></p>

<p><strong>示例&nbsp;3:</strong></p>
<div class="example-block">
<p><span class="example-io"><b>输入:</b>s = "()[]{}"</span></p>

<pre>
<strong>输入:</strong>s = "(]"
<strong>输出:</strong>false
</pre>
<p><span class="example-io"><b>输出:</b>true</span></p>
</div>

<p><strong class="example">示例 3:</strong></p>

<div class="example-block">
<p><span class="example-io"><b>输入:</b>s = "(]"</span></p>

<p><span class="example-io"><b>输出:</b>false</span></p>
</div>

<p><strong class="example">示例 4:</strong></p>

<div class="example-block">
<p><span class="example-io"><b>输入:</b>s = "([])"</span></p>

<p><span class="example-io"><b>输出:</b>true</span></p>
</div>

<p>&nbsp;</p>

Expand Down
4 changes: 2 additions & 2 deletions solution/0100-0199/0176.Second Highest Salary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ tags:
| id | int |
| salary | int |
+-------------+------+
在 SQL 中,id 是这个表的主键。
id 是这个表的主键。
表的每一行包含员工的工资信息。
</pre>

<p>&nbsp;</p>

<p>查询并返回 <code>Employee</code>&nbsp;表中第二高的薪水 。如果不存在第二高的薪水,查询应该返回 <code>null(Pandas 则返回 None)</code> 。</p>
<p>查询并返回 <code>Employee</code>&nbsp;表中第二高的 <b>不同</b>&nbsp;薪水 。如果不存在第二高的薪水,查询应该返回 <code>null(Pandas 则返回 None)</code> 。</p>

<p>查询结果如下例所示。</p>

Expand Down
2 changes: 1 addition & 1 deletion solution/0100-0199/0176.Second Highest Salary/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Each row of this table contains information about the salary of an employee.

<p>&nbsp;</p>

<p>Write a solution to find&nbsp;the second highest salary from the <code>Employee</code> table. If there is no second highest salary,&nbsp;return&nbsp;<code>null (return&nbsp;None in Pandas)</code>.</p>
<p>Write a solution to find&nbsp;the second highest <strong>distinct</strong> salary from the <code>Employee</code> table. If there is no second highest salary,&nbsp;return&nbsp;<code>null (return&nbsp;None in Pandas)</code>.</p>

<p>The result format is in the following example.</p>

Expand Down
2 changes: 1 addition & 1 deletion solution/0100-0199/0197.Rising Temperature/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This table contains information about the temperature on a certain day.

<p>&nbsp;</p>

<p>Write a solution to find all dates&#39; <code>Id</code> with higher temperatures compared to its previous dates (yesterday).</p>
<p>Write a solution to find all dates&#39; <code>id</code> with higher temperatures compared to its previous dates (yesterday).</p>

<p>Return the result table in <strong>any order</strong>.</p>

Expand Down
45 changes: 36 additions & 9 deletions solution/0200-0299/0205.Isomorphic Strings/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,42 @@ tags:

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<pre><strong>Input:</strong> s = "egg", t = "add"
<strong>Output:</strong> true
</pre><p><strong class="example">Example 2:</strong></p>
<pre><strong>Input:</strong> s = "foo", t = "bar"
<strong>Output:</strong> false
</pre><p><strong class="example">Example 3:</strong></p>
<pre><strong>Input:</strong> s = "paper", t = "title"
<strong>Output:</strong> true
</pre>

<div class="example-block">
<p><strong>Input:</strong> <span class="example-io">s = &quot;egg&quot;, t = &quot;add&quot;</span></p>

<p><strong>Output:</strong> <span class="example-io">true</span></p>

<p><strong>Explanation:</strong></p>

<p>The strings <code>s</code> and <code>t</code> can be made identical by:</p>

<ul>
<li>Mapping <code>&#39;e&#39;</code> to <code>&#39;a&#39;</code>.</li>
<li>Mapping <code>&#39;g&#39;</code> to <code>&#39;d&#39;</code>.</li>
</ul>
</div>

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

<div class="example-block">
<p><strong>Input:</strong> <span class="example-io">s = &quot;foo&quot;, t = &quot;bar&quot;</span></p>

<p><strong>Output:</strong> <span class="example-io">false</span></p>

<p><strong>Explanation:</strong></p>

<p>The strings <code>s</code> and <code>t</code> can not be made identical as <code>&#39;o&#39;</code> needs to be mapped to both <code>&#39;a&#39;</code> and <code>&#39;r&#39;</code>.</p>
</div>

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

<div class="example-block">
<p><strong>Input:</strong> <span class="example-io">s = &quot;paper&quot;, t = &quot;title&quot;</span></p>

<p><strong>Output:</strong> <span class="example-io">true</span></p>
</div>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

Expand Down
16 changes: 8 additions & 8 deletions solution/0200-0299/0242.Valid Anagram/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ tags:

<p>给定两个字符串 <code><em>s</em></code> 和 <code><em>t</em></code> ,编写一个函数来判断 <code><em>t</em></code> 是否是 <code><em>s</em></code> 的字母异位词。</p>

<p><strong>注意:</strong>若 <code><em>s</em></code> 和 <code><em>t</em></code><em> </em>中每个字符出现的次数都相同,则称 <code><em>s</em></code> 和 <code><em>t</em></code><em> </em>互为字母异位词。</p>
<p><strong>字母异位词</strong> 是通过重新排列不同单词或短语的字母而形成的单词或短语,通常只使用所有原始字母一次。</p>

<p> </p>
<p>&nbsp;</p>

<p><strong>示例 1:</strong></p>
<p><strong>示例&nbsp;1:</strong></p>

<pre>
<strong>输入:</strong> <em>s</em> = "anagram", <em>t</em> = "nagaram"
Expand All @@ -37,18 +37,18 @@ tags:
<strong>输入:</strong> <em>s</em> = "rat", <em>t</em> = "car"
<strong>输出: </strong>false</pre>

<p> </p>
<p>&nbsp;</p>

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

<ul>
<li><code>1 <= s.length, t.length <= 5 * 10<sup>4</sup></code></li>
<li><code>s</code> 和 <code>t</code> 仅包含小写字母</li>
<li><code>1 &lt;= s.length, t.length &lt;= 5 * 10<sup>4</sup></code></li>
<li><code>s</code> 和 <code>t</code>&nbsp;仅包含小写字母</li>
</ul>

<p> </p>
<p>&nbsp;</p>

<p><strong>进阶: </strong>如果输入字符串包含 unicode 字符怎么办?你能否调整你的解法来应对这种情况?</p>
<p><strong>进阶:&nbsp;</strong>如果输入字符串包含 unicode 字符怎么办?你能否调整你的解法来应对这种情况?</p>

<!-- description:end -->

Expand Down
2 changes: 1 addition & 1 deletion solution/0400-0499/0455.Assign Cookies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tags:

<p>假设你是一位很棒的家长,想要给你的孩子们一些小饼干。但是,每个孩子最多只能给一块饼干。</p>

<p>对每个孩子 <code>i</code>,都有一个胃口值&nbsp;<code>g[i]</code><sub>,</sub>这是能让孩子们满足胃口的饼干的最小尺寸;并且每块饼干 <code>j</code>,都有一个尺寸 <code>s[j]</code><sub>&nbsp;</sub>。如果 <code>s[j]&nbsp;&gt;= g[i]</code>,我们可以将这个饼干 <code>j</code> 分配给孩子 <code>i</code> ,这个孩子会得到满足。你的目标是尽可能满足越多数量的孩子,并输出这个最大数值。</p>
<p>对每个孩子 <code>i</code>,都有一个胃口值&nbsp;<code>g[i]</code><sub>,</sub>这是能让孩子们满足胃口的饼干的最小尺寸;并且每块饼干 <code>j</code>,都有一个尺寸 <code>s[j]</code><sub>&nbsp;</sub>。如果 <code>s[j]&nbsp;&gt;= g[i]</code>,我们可以将这个饼干 <code>j</code> 分配给孩子 <code>i</code> ,这个孩子会得到满足。你的目标是满足尽可能多的孩子,并输出这个最大数值。</p>
&nbsp;

<p><strong>示例&nbsp;1:</strong></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tags:

<p>给定一个表示分数加减运算的字符串&nbsp;<code>expression</code>&nbsp;,你需要返回一个字符串形式的计算结果。&nbsp;</p>

<p>这个结果应该是不可约分的分数,即<a href="https://baike.baidu.com/item/%E6%9C%80%E7%AE%80%E5%88%86%E6%95%B0" target="_blank">最简分数</a>。&nbsp;如果最终结果是一个整数,例如&nbsp;<code>2</code>,你需要将它转换成分数形式,其分母为&nbsp;<code>1</code>。所以在上述例子中, <code>2</code>&nbsp;应该被转换为&nbsp;<code>2/1</code>。</p>
<p>这个结果应该是不可约分的分数,即&nbsp;<a href="https://baike.baidu.com/item/%E6%9C%80%E7%AE%80%E5%88%86%E6%95%B0" target="_blank">最简分数</a>。&nbsp;如果最终结果是一个整数,例如&nbsp;<code>2</code>,你需要将它转换成分数形式,其分母为&nbsp;<code>1</code>。所以在上述例子中, <code>2</code>&nbsp;应该被转换为&nbsp;<code>2/1</code>。</p>

<p>&nbsp;</p>

Expand Down Expand Up @@ -52,9 +52,9 @@ tags:
<ul>
<li>输入和输出字符串只包含&nbsp;<code>'0'</code> 到&nbsp;<code>'9'</code>&nbsp;的数字,以及&nbsp;<code>'/'</code>, <code>'+'</code> 和&nbsp;<code>'-'</code>。&nbsp;</li>
<li>输入和输出分数格式均为&nbsp;<code>±分子/分母</code>。如果输入的第一个分数或者输出的分数是正数,则&nbsp;<code>'+'</code>&nbsp;会被省略掉。</li>
<li>输入只包含合法的<strong>最简分数</strong>,每个分数的<strong>分子</strong>与<strong>分母</strong>的范围是&nbsp;&nbsp;[1,10]。&nbsp;如果分母是1,意味着这个分数实际上是一个整数。</li>
<li>输入只包含合法的&nbsp;<strong>最简分数</strong>,每个分数的<strong>分子</strong>与<strong>分母</strong>的范围是&nbsp;<code>[1,10]</code>。&nbsp;如果分母是 1,意味着这个分数实际上是一个整数。</li>
<li>输入的分数个数范围是 [1,10]。</li>
<li><strong>最终结果</strong>的分子与分母保证是 32 位整数范围内的有效整数。</li>
<li><strong>最终结果&nbsp;</strong>的分子与分母保证是 32 位整数范围内的有效整数。</li>
</ul>

<!-- description:end -->
Expand Down
2 changes: 1 addition & 1 deletion solution/0600-0699/0626.Exchange Seats/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tags:
+-------------+---------+
<code>id</code> 是该表的主键(唯一值)列。
该表的每一行都表示学生的姓名和 ID。
id 是一个连续的增量
ID 序列始终从 1 开始并连续增加
</pre>

<p>&nbsp;</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ tags:
<ul>
<li><code>1 &lt;= nums.length &lt;= 2000</code></li>
<li><code>-10<sup>6</sup> &lt;= nums[i] &lt;= 10<sup>6</sup></code></li>
<li>The answer is guaranteed to fit inside a 32-bit integer.</li>
</ul>

<!-- description:end -->
Expand Down
2 changes: 1 addition & 1 deletion solution/0700-0799/0728.Self Dividing Numbers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tags:

<p><strong>自除数</strong> 不允许包含 0 。</p>

<p>给定两个整数&nbsp;<code>left</code>&nbsp;和&nbsp;<code>right</code> ,返回一个列表,<em>列表的元素是范围&nbsp;<code>[left, right]</code>&nbsp;内所有的 <strong>自除数</strong></em> 。</p>
<p>给定两个整数&nbsp;<code>left</code>&nbsp;和&nbsp;<code>right</code> ,返回一个列表,<em>列表的元素是范围&nbsp;<code>[left, right]</code>(包括两个端点)内所有的 <strong>自除数</strong></em> 。</p>

<p>&nbsp;</p>

Expand Down
2 changes: 1 addition & 1 deletion solution/0700-0799/0728.Self Dividing Numbers/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tags:

<p>A <strong>self-dividing number</strong> is not allowed to contain the digit zero.</p>

<p>Given two integers <code>left</code> and <code>right</code>, return <em>a list of all the <strong>self-dividing numbers</strong> in the range</em> <code>[left, right]</code>.</p>
<p>Given two integers <code>left</code> and <code>right</code>, return <em>a list of all the <strong>self-dividing numbers</strong> in the range</em> <code>[left, right]</code> (both <strong>inclusive</strong>).</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
Expand Down
2 changes: 1 addition & 1 deletion solution/0800-0899/0840.Magic Squares In Grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tags:

<p><code>3 x 3</code> 的幻方是一个填充有&nbsp;<strong>从 <code>1</code> 到 <code>9</code>&nbsp;</strong> 的不同数字的 <code>3 x 3</code> 矩阵,其中每行,每列以及两条对角线上的各数之和都相等。</p>

<p>给定一个由整数组成的<code>row x col</code>&nbsp;的 <code>grid</code>,其中有多少个&nbsp;<code>3 × 3</code> 的 “幻方” 子矩阵?(每个子矩阵都是连续的)。</p>
<p>给定一个由整数组成的<code>row x col</code>&nbsp;的 <code>grid</code>,其中有多少个&nbsp;<code>3 × 3</code> 的 “幻方” 子矩阵?</p>

<p>注意:虽然幻方只能包含 1 到 9 的数字,但&nbsp;<code>grid</code> 可以包含最多15的数字。</p>

Expand Down
12 changes: 5 additions & 7 deletions solution/0900-0999/0909.Snakes and Ladders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ tags:

<!-- description:start -->

<p>给你一个大小为 <code>n x n</code> 的整数矩阵 <code>board</code> ,方格按从&nbsp;<code>1</code> 到 <code>n<sup>2</sup></code> 编号,编号遵循 <a href="https://baike.baidu.com/item/%E7%89%9B%E8%80%95%E5%BC%8F%E8%BD%AC%E8%A1%8C%E4%B9%A6%E5%86%99%E6%B3%95/17195786">转行交替方式</a><strong> </strong>,<strong>从左下角开始</strong>&nbsp;(即,从 <code>board[n - 1][0]</code> 开始)每一行交替方向。</p>
<p>给你一个大小为 <code>n x n</code> 的整数矩阵 <code>board</code> ,方格按从&nbsp;<code>1</code> 到 <code>n<sup>2</sup></code> 编号,编号遵循 <a href="https://baike.baidu.com/item/%E7%89%9B%E8%80%95%E5%BC%8F%E8%BD%AC%E8%A1%8C%E4%B9%A6%E5%86%99%E6%B3%95/17195786">转行交替方式</a><strong> </strong>,<strong>从左下角开始</strong>&nbsp;(即,从 <code>board[n - 1][0]</code> 开始)的每一行改变方向。</p>

<p>玩家从棋盘上的方格&nbsp;<code>1</code> (总是在最后一行、第一列)开始出发。</p>

<p>每一回合,玩家需要从当前方格 <code>curr</code> 开始出发,按下述要求前进:</p>
<p>你一开始位于棋盘上的方格&nbsp; <code>1</code>。每一回合,玩家需要从当前方格 <code>curr</code> 开始出发,按下述要求前进:</p>

<ul>
<li>选定目标方格 <code>next</code> ,目标方格的编号符合范围&nbsp;<code>[curr + 1, min(curr + 6, n<sup>2</sup>)]</code> 。
<li>选定目标方格 <code>next</code> ,目标方格的编号在范围&nbsp;<code>[curr + 1, min(curr + 6, n<sup>2</sup>)]</code> 。

<ul>
<li>该选择模拟了掷 <strong>六面体骰子</strong> 的情景,无论棋盘大小如何,玩家最多只能有 6 个目的地。</li>
Expand All @@ -36,12 +34,12 @@ tags:

</ul>

<p><code>r</code> 行 <code>c</code> 列的棋盘,按前述方法编号,棋盘格中可能存在 “蛇” 或 “梯子”;如果 <code>board[r][c] != -1</code>,那个蛇或梯子的目的地将会是 <code>board[r][c]</code>。编号为 <code>1</code> 和 <code>n<sup>2</sup></code> 的方格不是任何蛇或梯子的起点。</p>
<p>如果 <code>board[r][c] != -1</code>&nbsp;,位于&nbsp;<code>r</code> 行 <code>c</code> 列的棋盘格中可能存在 “蛇” 或 “梯子”那个蛇或梯子的目的地将会是 <code>board[r][c]</code>。编号为 <code>1</code> 和 <code>n<sup>2</sup></code> 的方格不是任何蛇或梯子的起点。</p>

<p>注意,玩家在每回合的前进过程中最多只能爬过蛇或梯子一次:就算目的地是另一条蛇或梯子的起点,玩家也 <strong>不能</strong> 继续移动。</p>

<ul>
<li>举个例子,假设棋盘是 <code>[[-1,4],[-1,3]]</code> ,第一次移动,玩家的目标方格是 <code>2</code> 。那么这个玩家将会顺着梯子到达方格 <code>3</code> ,但 <strong>不能</strong> 顺着方格 <code>3</code> 上的梯子前往方格 <code>4</code> 。</li>
<li>举个例子,假设棋盘是 <code>[[-1,4],[-1,3]]</code> ,第一次移动,玩家的目标方格是 <code>2</code> 。那么这个玩家将会顺着梯子到达方格 <code>3</code> ,但 <strong>不能</strong> 顺着方格 <code>3</code> 上的梯子前往方格 <code>4</code> 。(简单来说,类似飞行棋,玩家掷出骰子点数后移动对应格数,遇到单向的路径(即梯子或蛇)可以直接跳到路径的终点,但如果多个路径首尾相连,也不能连续跳多个路径)</li>
</ul>

<p>返回达到编号为&nbsp;<code>n<sup>2</sup></code> 的方格所需的最少移动次数,如果不可能,则返回 <code>-1</code>。</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,56 +21,57 @@ tags:

<!-- description:start -->

<p>在一个长度 <strong>无限 </strong>的数轴上,第 <code>i</code> 颗石子的位置为 <code>stones[i]</code>。如果一颗石子的位置最小/最大,那么该石子被称作 <strong>端点石子 </strong>。</p>
<p>在 X 轴上有一些不同位置的石子。给定一个整数数组&nbsp;<code>stones</code>&nbsp;表示石子的位置。</p>

<p>每个回合,你可以将一颗端点石子拿起并移动到一个未占用的位置,使得该石子不再是一颗端点石子。</p>
<p>如果一个石子在最小或最大的位置,称其为&nbsp;<strong>端点石子</strong>。每个回合,你可以将一颗 <strong>端点石子</strong> 拿起并移动到一个未占用的位置,使得该石子不再是一颗 <strong>端点石子</strong>。</p>

<p>值得注意的是,如果石子像 <code>stones = [1,2,5]</code> 这样,你将 <strong>无法 </strong>移动位于位置 5 的端点石子,因为无论将它移动到任何位置(例如 0 或 3),该石子都仍然会是端点石子。</p>
<ul>
<li>值得注意的是,如果石子像&nbsp;<code>stones = [1,2,5]</code>&nbsp;这样,你将 <strong>无法 </strong>移动位于位置 <code>5</code> 的端点石子,因为无论将它移动到任何位置(例如 <code>0</code> 或 <code>3</code>),该石子都仍然会是端点石子。</li>
</ul>

<p>当你无法进行任何移动时,即,这些石子的位置连续时,游戏结束。</p>

<p>要使游戏结束,你可以执行的最小和最大移动次数分别是多少? 以长度为 2 的数组形式返回答案:<code>answer = [minimum_moves, maximum_moves]</code> 。</p>
<p>以长度为 2 的数组形式返回答案,其中:</p>

<ul>
<li><code>answer[0]</code>&nbsp;是你可以移动的最小次数</li>
<li><code>answer[1]</code>&nbsp;是你可以移动的最大次数。</li>
</ul>

<p> </p>
<p>&nbsp;</p>

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

<pre>
<strong>输入:</strong>[7,4,9]
<strong>输出:</strong>[1,2]
<strong>解释:</strong>
我们可以移动一次,4 -> 8,游戏结束。
或者,我们可以移动两次 9 -> 5,4 -> 6,游戏结束。
我们可以移动一次,4 -&gt; 8,游戏结束。
或者,我们可以移动两次 9 -&gt; 5,4 -&gt; 6,游戏结束。
</pre>

<p><strong>示例 2:</strong></p>
<p><strong>示例&nbsp;2:</strong></p>

<pre>
<strong>输入:</strong>[6,5,4,3,10]
<strong>输出:</strong>[2,3]
<strong>解释:</strong>
我们可以移动 3 -> 8,接着是 10 -> 7,游戏结束。
或者,我们可以移动 3 -> 7, 4 -> 8, 5 -> 9,游戏结束。
注意,我们无法进行 10 -> 2 这样的移动来结束游戏,因为这是不合要求的移动。
我们可以移动 3 -&gt; 8,接着是 10 -&gt; 7,游戏结束。
或者,我们可以移动 3 -&gt; 7, 4 -&gt; 8, 5 -&gt; 9,游戏结束。
注意,我们无法进行 10 -&gt; 2 这样的移动来结束游戏,因为这是不合要求的移动。
</pre>

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

<pre>
<strong>输入:</strong>[100,101,104,102,103]
<strong>输出:</strong>[0,0]</pre>

<p> </p>
<p>&nbsp;</p>

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

<ul>
<li><code>3 <= stones.length <= 10^4</code></li>
<li><code>1 <= stones[i] <= 10^9</code></li>
<li><code>stones[i]</code> 的值各不相同。</li>
<li><code>3 &lt;= stones.length &lt;= 10<sup>4</sup></code></li>
<li><code>1 &lt;= stones[i] &lt;= 10<sup>9</sup></code></li>
<li><code>stones</code>&nbsp;的值各不相同。</li>
</ul>

<p> </p>
<p>&nbsp;</p>

<!-- description:end -->

Expand Down
Loading
Loading