mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 15:31:43 +08:00
update
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<p>给你一个 <code>m x n</code> 大小的矩阵 <code>grid</code> ,由若干正整数组成。</p>
|
||||
|
||||
<p>执行下述操作,直到 <code>grid</code> 变为空矩阵:</p>
|
||||
|
||||
<ul>
|
||||
<li>从每一行删除值最大的元素。如果存在多个这样的值,删除其中任何一个。</li>
|
||||
<li>将删除元素中的最大值与答案相加。</li>
|
||||
</ul>
|
||||
|
||||
<p><strong>注意</strong> 每执行一次操作,矩阵中列的数据就会减 1 。</p>
|
||||
|
||||
<p>返回执行上述操作后的答案。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/10/19/q1ex1.jpg" style="width: 600px; height: 135px;" /></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>grid = [[1,2,4],[3,3,1]]
|
||||
<strong>输出:</strong>8
|
||||
<strong>解释:</strong>上图展示在每一步中需要移除的值。
|
||||
- 在第一步操作中,从第一行删除 4 ,从第二行删除 3(注意,有两个单元格中的值为 3 ,我们可以删除任一)。在答案上加 4 。
|
||||
- 在第二步操作中,从第一行删除 2 ,从第二行删除 3 。在答案上加 3 。
|
||||
- 在第三步操作中,从第一行删除 1 ,从第二行删除 1 。在答案上加 1 。
|
||||
最终,答案 = 4 + 3 + 1 = 8 。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/10/19/q1ex2.jpg" style="width: 83px; height: 83px;" /></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>grid = [[10]]
|
||||
<strong>输出:</strong>10
|
||||
<strong>解释:</strong>上图展示在每一步中需要移除的值。
|
||||
- 在第一步操作中,从第一行删除 10 。在答案上加 10 。
|
||||
最终,答案 = 10 。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>m == grid.length</code></li>
|
||||
<li><code>n == grid[i].length</code></li>
|
||||
<li><code>1 <= m, n <= 50</code></li>
|
||||
<li><code>1 <= grid[i][j] <= 100</code></li>
|
||||
</ul>
|
@@ -0,0 +1,49 @@
|
||||
<p>给你一个 <code>n</code> 个点的无向图,节点从 <code>0</code> 到 <code>n - 1</code> 编号。给你一个长度为 <code>n</code> 下标从 <strong>0</strong> 开始的整数数组 <code>vals</code> ,其中 <code>vals[i]</code> 表示第 <code>i</code> 个节点的值。</p>
|
||||
|
||||
<p>同时给你一个二维整数数组 <code>edges</code> ,其中 <code>edges[i] = [a<sub>i</sub>, b<sub>i</sub>]</code> 表示节点 <code>a<sub>i</sub></code> 和 <code>b<sub>i</sub></code> 之间有一条双向边。</p>
|
||||
|
||||
<p><strong>星图</strong> 是给定图中的一个子图,它包含一个中心节点和 <code>0</code> 个或更多个邻居。换言之,星图是给定图中一个边的子集,且这些边都有一个公共节点。</p>
|
||||
|
||||
<p>下图分别展示了有 <code>3</code> 个和 <code>4</code> 个邻居的星图,蓝色节点为中心节点。</p>
|
||||
|
||||
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/11/07/max-star-sum-descdrawio.png" style="width: 400px; height: 179px;"></p>
|
||||
|
||||
<p><strong>星和</strong> 定义为星图中所有节点值的和。</p>
|
||||
|
||||
<p>给你一个整数 <code>k</code> ,请你返回 <strong>至多</strong> 包含 <code>k</code> 条边的星图中的 <strong>最大星和</strong> 。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/11/07/max-star-sum-example1drawio.png" style="width: 300px; height: 291px;"></p>
|
||||
|
||||
<pre><b>输入:</b>vals = [1,2,3,4,10,-10,-20], edges = [[0,1],[1,2],[1,3],[3,4],[3,5],[3,6]], k = 2
|
||||
<b>输出:</b>16
|
||||
<b>解释:</b>上图展示了输入示例。
|
||||
最大星和对应的星图在上图中用蓝色标出。中心节点是 3 ,星图中还包含邻居 1 和 4 。
|
||||
无法得到一个和大于 16 且边数不超过 2 的星图。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre><b>输入:</b>vals = [-5], edges = [], k = 0
|
||||
<b>输出:</b>-5
|
||||
<b>解释:</b>只有一个星图,就是节点 0 自己。
|
||||
所以我们返回 -5 。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>n == vals.length</code></li>
|
||||
<li><code>1 <= n <= 10<sup>5</sup></code></li>
|
||||
<li><code>-10<sup>4</sup> <= vals[i] <= 10<sup>4</sup></code></li>
|
||||
<li><code>0 <= edges.length <= min(n * (n - 1) / 2</code><code>, 10<sup>5</sup>)</code></li>
|
||||
<li><code>edges[i].length == 2</code></li>
|
||||
<li><code>0 <= a<sub>i</sub>, b<sub>i</sub> <= n - 1</code></li>
|
||||
<li><code>a<sub>i</sub> != b<sub>i</sub></code></li>
|
||||
<li><code>0 <= k <= n - 1</code></li>
|
||||
</ul>
|
@@ -0,0 +1,42 @@
|
||||
<p>一个由字母和数字组成的字符串的 <strong>值</strong> 定义如下:</p>
|
||||
|
||||
<ul>
|
||||
<li>如果字符串 <strong>只</strong> 包含数字,那么值为该字符串在 <code>10</code> 进制下的所表示的数字。</li>
|
||||
<li>否则,值为字符串的 <strong>长度 </strong>。</li>
|
||||
</ul>
|
||||
|
||||
<p>给你一个字符串数组 <code>strs</code> ,每个字符串都只由字母和数字组成,请你返回 <code>strs</code> 中字符串的 <strong>最大值</strong> 。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>strs = ["alic3","bob","3","4","00000"]
|
||||
<b>输出:</b>5
|
||||
<b>解释:</b>
|
||||
- "alic3" 包含字母和数字,所以值为长度 5 。
|
||||
- "bob" 只包含字母,所以值为长度 3 。
|
||||
- "3" 只包含数字,所以值为 3 。
|
||||
- "4" 只包含数字,所以值为 4 。
|
||||
- "00000" 只包含数字,所以值为 0 。
|
||||
所以最大的值为 5 ,是字符串 "alic3" 的值。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<b>输入:</b>strs = ["1","01","001","0001"]
|
||||
<b>输出:</b>1
|
||||
<b>解释:</b>
|
||||
数组中所有字符串的值都是 1 ,所以我们返回 1 。</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= strs.length <= 100</code></li>
|
||||
<li><code>1 <= strs[i].length <= 9</code></li>
|
||||
<li><code>strs[i]</code> 只包含小写英文字母和数字。</li>
|
||||
</ul>
|
@@ -0,0 +1,39 @@
|
||||
<p>给你一个整数数组 <code>nums</code> 。如果 <code>nums</code> 的子序列满足下述条件,则认为该子序列是一个 <strong>方波</strong> :</p>
|
||||
|
||||
<ul>
|
||||
<li>子序列的长度至少为 <code>2</code> ,并且</li>
|
||||
<li>将子序列从小到大排序 <strong>之后</strong> ,除第一个元素外,每个元素都是前一个元素的 <strong>平方</strong> 。</li>
|
||||
</ul>
|
||||
|
||||
<p>返回<em> </em><code>nums</code><em> </em>中 <strong>最长方波</strong> 的长度,如果不存在 <strong>方波</strong><em> </em>则返回<em> </em><code>-1</code> 。</p>
|
||||
|
||||
<p><strong>子序列</strong> 也是一个数组,可以由另一个数组删除一些或不删除元素且不改变剩余元素的顺序得到。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1 :</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>nums = [4,3,6,16,8,2]
|
||||
<strong>输出:</strong>3
|
||||
<strong>解释:</strong>选出子序列 [4,16,2] 。排序后,得到 [2,4,16] 。
|
||||
- 4 = 2 * 2.
|
||||
- 16 = 4 * 4.
|
||||
因此,[4,16,2] 是一个方波.
|
||||
可以证明长度为 4 的子序列都不是方波。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2 :</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>nums = [2,3,5,6,7]
|
||||
<strong>输出:</strong>-1
|
||||
<strong>解释:</strong>nums 不存在方波,所以返回 -1 。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>2 <= nums.length <= 10<sup>5</sup></code></li>
|
||||
<li><code>2 <= nums[i] <= 10<sup>5</sup></code></li>
|
||||
</ul>
|
@@ -0,0 +1,41 @@
|
||||
<p>给你一个大小为 <code>m x n</code> 的整数矩阵 <code>grid</code> 和一个大小为 <code>k</code> 的数组 <code>queries</code> 。</p>
|
||||
|
||||
<p>找出一个大小为 <code>k</code> 的数组 <code>answer</code> ,且满足对于每个整数 <code>queres[i]</code> ,你从矩阵 <strong>左上角</strong> 单元格开始,重复以下过程:</p>
|
||||
|
||||
<ul>
|
||||
<li>如果 <code>queries[i]</code> <strong>严格</strong> 大于你当前所处位置单元格,如果该单元格是第一次访问,则获得 1 分,并且你可以移动到所有 <code>4</code> 个方向(上、下、左、右)上任一 <strong>相邻</strong> 单元格。</li>
|
||||
<li>否则,你不能获得任何分,并且结束这一过程。</li>
|
||||
</ul>
|
||||
|
||||
<p>在过程结束后,<code>answer[i]</code> 是你可以获得的最大分数。注意,对于每个查询,你可以访问同一个单元格 <strong>多次</strong> 。</p>
|
||||
|
||||
<p>返回结果数组 <code>answer</code> 。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2022/10/19/yetgriddrawio.png" style="width: 571px; height: 151px;">
|
||||
<pre><strong>输入:</strong>grid = [[1,2,3],[2,5,7],[3,5,1]], queries = [5,6,2]
|
||||
<strong>输出:</strong>[5,8,1]
|
||||
<strong>解释:</strong>上图展示了每个查询中访问并获得分数的单元格。</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2022/10/20/yetgriddrawio-2.png">
|
||||
<pre><strong>输入:</strong>grid = [[5,2,1],[1,1,2]], queries = [3]
|
||||
<strong>输出:</strong>[0]
|
||||
<strong>解释:</strong>无法获得分数,因为左上角单元格的值大于等于 3 。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>m == grid.length</code></li>
|
||||
<li><code>n == grid[i].length</code></li>
|
||||
<li><code>2 <= m, n <= 1000</code></li>
|
||||
<li><code>4 <= m * n <= 10<sup>5</sup></code></li>
|
||||
<li><code>k == queries.length</code></li>
|
||||
<li><code>1 <= k <= 10<sup>4</sup></code></li>
|
||||
<li><code>1 <= grid[i][j], queries[i] <= 10<sup>6</sup></code></li>
|
||||
</ul>
|
@@ -0,0 +1,55 @@
|
||||
<p>给你两个下标从 <strong>0</strong> 开始的整数数组 <code>nums1</code> 和 <code>nums2</code> ,两者长度都为 <code>n</code> 。</p>
|
||||
|
||||
<p>每次操作中,你可以选择交换 <code>nums1</code> 中任意两个下标处的值。操作的 <strong>开销</strong> 为两个下标的 <strong>和</strong> 。</p>
|
||||
|
||||
<p>你的目标是对于所有的 <code>0 <= i <= n - 1</code> ,都满足 <code>nums1[i] != nums2[i]</code> ,你可以进行 <strong>任意次</strong> 操作,请你返回达到这个目标的 <strong>最小</strong> 总代价。</p>
|
||||
|
||||
<p>请你返回让<em> </em><code>nums1</code> 和 <code>nums2</code><em> </em>满足上述条件的 <strong>最小总代价</strong> ,如果无法达成目标,返回 <code>-1</code> 。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<b>输入:</b>nums1 = [1,2,3,4,5], nums2 = [1,2,3,4,5]
|
||||
<b>输出:</b>10
|
||||
<b>解释:</b>
|
||||
实现目标的其中一种方法为:
|
||||
- 交换下标为 0 和 3 的两个值,代价为 0 + 3 = 3 。现在 nums1 = [4,2,3,1,5] 。
|
||||
- 交换下标为 1 和 2 的两个值,代价为 1 + 2 = 3 。现在 nums1 = [4,3,2,1,5] 。
|
||||
- 交换下标为 0 和 4 的两个值,代价为 0 + 4 = 4 。现在 nums1 = [5,3,2,1,4] 。
|
||||
最后,对于每个下标 i ,都有 nums1[i] != nums2[i] 。总代价为 10 。
|
||||
还有别的交换值的方法,但是无法得到代价和小于 10 的方案。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<b>输入:</b>nums1 = [2,2,2,1,3], nums2 = [1,2,2,3,3]
|
||||
<b>输出:</b>10
|
||||
<b>解释:</b>
|
||||
实现目标的一种方法为:
|
||||
- 交换下标为 2 和 3 的两个值,代价为 2 + 3 = 5 。现在 nums1 = [2,2,1,2,3] 。
|
||||
- 交换下标为 1 和 4 的两个值,代价为 1 + 4 = 5 。现在 nums1 = [2,3,1,2,2] 。
|
||||
总代价为 10 ,是所有方案中的最小代价。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<b>输入:</b>nums1 = [1,2,2], nums2 = [1,2,2]
|
||||
<b>输出:</b>-1
|
||||
<b>解释:</b>
|
||||
不管怎么操作,都无法满足题目要求。
|
||||
所以返回 -1 。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>n == nums1.length == nums2.length</code></li>
|
||||
<li><code>1 <= n <= 10<sup>5</sup></code></li>
|
||||
<li><code>1 <= nums1[i], nums2[i] <= n</code></li>
|
||||
</ul>
|
@@ -0,0 +1,56 @@
|
||||
<p>给你一个整数 <code>n</code> ,表示下标从 <strong>0</strong> 开始的内存数组的大小。所有内存单元开始都是空闲的。</p>
|
||||
|
||||
<p>请你设计一个具备以下功能的内存分配器:</p>
|
||||
|
||||
<ol>
|
||||
<li><strong>分配 </strong>一块大小为 <code>size</code> 的连续空闲内存单元并赋 id <code>mID</code> 。</li>
|
||||
<li><strong>释放</strong> 给定 id <code>mID</code> 对应的所有内存单元。</li>
|
||||
</ol>
|
||||
|
||||
<p><strong>注意:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li>多个块可以被分配到同一个 <code>mID</code> 。</li>
|
||||
<li>你必须释放 <code>mID</code> 对应的所有内存单元,即便这些内存单元被分配在不同的块中。</li>
|
||||
</ul>
|
||||
|
||||
<p>实现 <code>Allocator</code> 类:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>Allocator(int n)</code> 使用一个大小为 <code>n</code> 的内存数组初始化 <code>Allocator</code> 对象。</li>
|
||||
<li><code>int allocate(int size, int mID)</code> 找出大小为 <code>size</code> 个连续空闲内存单元且位于 <strong>最左侧</strong> 的块,分配并赋 id <code>mID</code> 。返回块的第一个下标。如果不存在这样的块,返回 <code>-1</code> 。</li>
|
||||
<li><code>int free(int mID)</code> 释放 id <code>mID</code> 对应的所有内存单元。返回释放的内存单元数目。</li>
|
||||
</ul>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例:</strong></p>
|
||||
|
||||
<pre><strong>输入</strong>
|
||||
["Allocator", "allocate", "allocate", "allocate", "free", "allocate", "allocate", "allocate", "free", "allocate", "free"]
|
||||
[[10], [1, 1], [1, 2], [1, 3], [2], [3, 4], [1, 1], [1, 1], [1], [10, 2], [7]]
|
||||
<strong>输出</strong>
|
||||
[null, 0, 1, 2, 1, 3, 1, 6, 3, -1, 0]
|
||||
|
||||
<strong>解释</strong>
|
||||
Allocator loc = new Allocator(10); // 初始化一个大小为 10 的内存数组,所有内存单元都是空闲的。
|
||||
loc.allocate(1, 1); // 最左侧的块的第一个下标是 0 。内存数组变为 [<strong>1</strong>, , , , , , , , , ]。返回 0 。
|
||||
loc.allocate(1, 2); // 最左侧的块的第一个下标是 1 。内存数组变为 [1,<strong>2</strong>, , , , , , , , ]。返回 1 。
|
||||
loc.allocate(1, 3); // 最左侧的块的第一个下标是 2 。内存数组变为 [1,2,<strong>3</strong>, , , , , , , ]。返回 2 。
|
||||
loc.free(2); // 释放 mID 为 2 的所有内存单元。内存数组变为 [1, ,<strong>3</strong>, , , , , , , ] 。返回 1 ,因为只有 1 个 mID 为 2 的内存单元。
|
||||
loc.allocate(3, 4); // 最左侧的块的第一个下标是 3 。内存数组变为 [1, ,3,<strong>4</strong>,<strong>4</strong>,<strong>4</strong>, , , , ]。返回 3 。
|
||||
loc.allocate(1, 1); // 最左侧的块的第一个下标是 1 。内存数组变为 [1,<strong>1</strong>,3,4,4,4, , , , ]。返回 1 。
|
||||
loc.allocate(1, 1); // 最左侧的块的第一个下标是 6 。内存数组变为 [1,1,3,4,4,4,<strong>1</strong>, , , ]。返回 6 。
|
||||
loc.free(1); // 释放 mID 为 1 的所有内存单元。内存数组变为 [ , ,3,4,4,4,<strong> </strong>, , , ] 。返回 3 ,因为有 3 个 mID 为 1 的内存单元。
|
||||
loc.allocate(10, 2); // 无法找出长度为 10 个连续空闲内存单元的空闲块,所有返回 -1 。
|
||||
loc.free(7); // 释放 mID 为 7 的所有内存单元。内存数组保持原状,因为不存在 mID 为 7 的内存单元。返回 0 。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= n, size, mID <= 1000</code></li>
|
||||
<li>最多调用 <code>allocate</code> 和 <code>free</code> 方法 <code>1000</code> 次</li>
|
||||
</ul>
|
51
leetcode-cn/problem (Chinese)/青蛙过河 II [frog-jump-ii].html
Normal file
51
leetcode-cn/problem (Chinese)/青蛙过河 II [frog-jump-ii].html
Normal file
@@ -0,0 +1,51 @@
|
||||
<p>给你一个下标从 <strong>0</strong> 开始的整数数组 <code>stones</code> ,数组中的元素 <strong>严格递增</strong> ,表示一条河中石头的位置。</p>
|
||||
|
||||
<p>一只青蛙一开始在第一块石头上,它想到达最后一块石头,然后回到第一块石头。同时每块石头 <strong>至多</strong> 到达 <strong>一次。</strong></p>
|
||||
|
||||
<p>一次跳跃的 <strong>长度</strong> 是青蛙跳跃前和跳跃后所在两块石头之间的距离。</p>
|
||||
|
||||
<ul>
|
||||
<li>更正式的,如果青蛙从 <code>stones[i]</code> 跳到 <code>stones[j]</code> ,跳跃的长度为 <code>|stones[i] - stones[j]|</code> 。</li>
|
||||
</ul>
|
||||
|
||||
<p>一条路径的 <b>代价</b> 是这条路径里的 <b>最大跳跃长度</b> 。</p>
|
||||
|
||||
<p>请你返回这只青蛙的 <strong>最小代价</strong> 。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/11/14/example-1.png" style="width: 600px; height: 219px;" /></p>
|
||||
|
||||
<pre>
|
||||
<b>输入:</b>stones = [0,2,5,6,7]
|
||||
<b>输出:</b>5
|
||||
<b>解释:</b>上图展示了一条最优路径。
|
||||
这条路径的代价是 5 ,是这条路径中的最大跳跃长度。
|
||||
无法得到一条代价小于 5 的路径,我们返回 5 。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
|
||||
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/11/14/example-2.png" style="width: 500px; height: 171px;" /></p>
|
||||
|
||||
<pre>
|
||||
<b>输入:</b>stones = [0,3,9]
|
||||
<b>输出:</b>9
|
||||
<b>解释:</b>
|
||||
青蛙可以直接跳到最后一块石头,然后跳回第一块石头。
|
||||
在这条路径中,每次跳跃长度都是 9 。所以路径代价是 max(9, 9) = 9 。
|
||||
这是可行路径中的最小代价。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>2 <= stones.length <= 10<sup>5</sup></code></li>
|
||||
<li><code>0 <= stones[i] <= 10<sup>9</sup></code></li>
|
||||
<li><code>stones[0] == 0</code></li>
|
||||
<li><code>stones</code> 中的元素严格递增。</li>
|
||||
</ul>
|
Reference in New Issue
Block a user