Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ tags:
<pre>
<strong>输入: </strong>s = "abcabcbb"
<strong>输出: </strong>3
<strong>解释:</strong> 因为无重复字符的最长子串是 <code>"abc"</code>,所以其长度为 3。
<strong>解释:</strong> 因为无重复字符的最长子串是 <code>"abc"</code>,所以其长度为 3。注意 "bca" 和 "cab" 也是正确答案。
</pre>

<p><strong>示例 2:</strong></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ tags:

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

<pre>
<strong>输入:</strong>digits = ""
<strong>输出:</strong>[]
</pre>

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

<pre>
<strong>输入:</strong>digits = "2"
<strong>输出:</strong>["a","b","c"]
Expand All @@ -52,7 +45,7 @@ tags:
<p><strong>提示:</strong></p>

<ul>
<li><code>0 &lt;= digits.length &lt;= 4</code></li>
<li><code>1 &lt;= digits.length &lt;= 4</code></li>
<li><code>digits[i]</code> 是范围 <code>['2', '9']</code> 的一个数字。</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ tags:

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

<pre>
<strong>Input:</strong> digits = &quot;&quot;
<strong>Output:</strong> []
</pre>

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

<pre>
<strong>Input:</strong> digits = &quot;2&quot;
<strong>Output:</strong> [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;]
Expand All @@ -48,7 +41,7 @@ tags:
<p><strong>Constraints:</strong></p>

<ul>
<li><code>0 &lt;= digits.length &lt;= 4</code></li>
<li><code>1 &lt;= digits.length &lt;= 4</code></li>
<li><code>digits[i]</code> is a digit in the range <code>[&#39;2&#39;, &#39;9&#39;]</code>.</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ tags:

<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>

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

<ul>
<li>更改数组 <code>nums</code> ,使 <code>nums</code> 的前 <code>k</code> 个元素包含唯一元素,并按照它们最初在 <code>nums</code> 中出现的顺序排列。<code>nums</code>&nbsp;的其余元素与 <code>nums</code> 的大小不重要。</li>
<li>返回 <code>k</code>&nbsp;。</li>
</ul>
<p><code>nums</code> 的前 <code>k</code> 个元素应包含 <strong>排序后</strong> 的唯一数字。下标&nbsp;<code>k - 1</code> 之后的剩余元素可以忽略。</p>

<p><strong>判题标准:</strong></p>

Expand Down Expand Up @@ -57,7 +54,7 @@ for (int i = 0; i &lt; k; i++) {

<pre>
<strong>输入:</strong>nums = [0,0,1,1,1,2,2,3,3,4]
<strong>输出:</strong>5, nums = [0,1,2,3,4]
<strong>输出:</strong>5, nums = [0,1,2,3,4,_,_,_,_,_]
<strong>解释:</strong>函数应该返回新的长度 <strong><code>5</code></strong> , 并且原数组 <em>nums </em>的前五个元素被修改为 <strong><code>0</code></strong>, <strong><code>1</code></strong>, <strong><code>2</code></strong>, <strong><code>3</code></strong>, <strong><code>4</code></strong> 。不需要考虑数组中超出新长度后面的元素。
</pre>

Expand All @@ -67,8 +64,8 @@ for (int i = 0; i &lt; k; i++) {

<ul>
<li><code>1 &lt;= nums.length &lt;= 3 * 10<sup>4</sup></code></li>
<li><code>-10<sup>4</sup> &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
<li><code>nums</code> 已按 <strong>非严格递增</strong>&nbsp;排列</li>
<li><code>-10<font size="1">0</font>&nbsp;&lt;= nums[i] &lt;= 10<font size="1">0</font></code></li>
<li><code>nums</code> 已按 <strong>非递减</strong>&nbsp;顺序排列。</li>
</ul>

<!-- description:end -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@ tags:

<!-- description:start -->

<p>Given an integer array <code>nums</code> sorted in <strong>non-decreasing order</strong>, remove the duplicates <a href="https://en.wikipedia.org/wiki/In-place_algorithm" target="_blank"><strong>in-place</strong></a> such that each unique element appears only <strong>once</strong>. The <strong>relative order</strong> of the elements should be kept the <strong>same</strong>. Then return <em>the number of unique elements in </em><code>nums</code>.</p>
<p>Given an integer array <code>nums</code> sorted in <strong>non-decreasing order</strong>, remove the duplicates <a href="https://en.wikipedia.org/wiki/In-place_algorithm" target="_blank"><strong>in-place</strong></a> such that each unique element appears only <strong>once</strong>. The <strong>relative order</strong> of the elements should be kept the <strong>same</strong>.</p>

<p>Consider the number of unique elements of <code>nums</code> to be <code>k</code>, to get accepted, you need to do the following things:</p>
<p>Consider the number of <em>unique elements</em> in&nbsp;<code>nums</code> to be <code>k<strong>​​​​​​​</strong></code>​​​​​​​. <meta charset="UTF-8" />After removing duplicates, return the number of unique elements&nbsp;<code>k</code>.</p>

<ul>
<li>Change the array <code>nums</code> such that the first <code>k</code> elements of <code>nums</code> contain the unique elements in the order they were present in <code>nums</code> initially. The remaining elements of <code>nums</code> are not important as well as the size of <code>nums</code>.</li>
<li>Return <code>k</code>.</li>
</ul>
<p><meta charset="UTF-8" />The first&nbsp;<code>k</code>&nbsp;elements of&nbsp;<code>nums</code>&nbsp;should contain the unique numbers in <strong>sorted order</strong>. The remaining elements beyond index&nbsp;<code>k - 1</code>&nbsp;can be ignored.</p>

<p><strong>Custom Judge:</strong></p>

Expand Down
2 changes: 1 addition & 1 deletion solution/0000-0099/0085.Maximal Rectangle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tags:
<ul>
<li><code>rows == matrix.length</code></li>
<li><code>cols == matrix[0].length</code></li>
<li><code>1 &lt;= row, cols &lt;= 200</code></li>
<li><code>1 &lt;= rows, cols &lt;= 200</code></li>
<li><code>matrix[i][j]</code> 为 <code>'0'</code> 或 <code>'1'</code></li>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion solution/0000-0099/0085.Maximal Rectangle/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ tags:
<ul>
<li><code>rows == matrix.length</code></li>
<li><code>cols == matrix[i].length</code></li>
<li><code>1 &lt;= row, cols &lt;= 200</code></li>
<li><code>1 &lt;= rows, cols &lt;= 200</code></li>
<li><code>matrix[i][j]</code> is <code>&#39;0&#39;</code> or <code>&#39;1&#39;</code>.</li>
</ul>

Expand Down
12 changes: 6 additions & 6 deletions solution/0100-0199/0118.Pascal's Triangle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ tags:

<!-- description:start -->

<p>给定一个非负整数 <em><code>numRows</code>,</em>生成「杨辉三角」的前 <em><code>numRows</code> </em>行。</p>
<p>给定一个非负整数&nbsp;<em><code>numRows</code>,</em>生成「杨辉三角」的前&nbsp;<em><code>numRows</code>&nbsp;</em>行。</p>

<p><small>在「杨辉三角」中,每个数是它左上方和右上方的数的和。</small></p>
<p>在<strong>「杨辉三角」</strong>中,每个数是它左上方和右上方的数的和。</p>

<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0100-0199/0118.Pascal%27s%20Triangle/images/1626927345-DZmfxB-PascalTriangleAnimated2.gif" /></p>

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

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

Expand All @@ -32,19 +32,19 @@ tags:
<strong>输出:</strong> [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]]
</pre>

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

<pre>
<strong>输入:</strong> numRows = 1
<strong>输出:</strong> [[1]]
</pre>

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

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

<ul>
<li><code>1 <= numRows <= 30</code></li>
<li><code>1 &lt;= numRows &lt;= 30</code></li>
</ul>

<!-- description:end -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tags:

<p>You are given an integer array <code>prices</code> where <code>prices[i]</code> is the price of a given stock on the <code>i<sup>th</sup></code> day.</p>

<p>On each day, you may decide to buy and/or sell the stock. You can only hold <strong>at most one</strong> share of the stock at any time. However, you can sell and buy the stock multiple times on the <strong>same day</strong>, ensuring you never hold than one share of the stock.</p>
<p>On each day, you may decide to buy and/or sell the stock. You can only hold <strong>at most one</strong> share of the stock at any time. However, you can sell and buy the stock multiple times on the <strong>same day</strong>, ensuring you never hold more than one share of the stock.</p>

<p>Find and return <em>the <strong>maximum</strong> profit you can achieve</em>.</p>

Expand Down
2 changes: 2 additions & 0 deletions solution/0100-0199/0152.Maximum Product Subarray/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ tags:

<p>测试用例的答案是一个&nbsp;<strong>32-位</strong> 整数。</p>

<p><strong>请注意</strong>,一个只包含一个元素的数组的乘积是这个元素的值。</p>

<p>&nbsp;</p>

<p><strong class="example">示例 1:</strong></p>
Expand Down
2 changes: 2 additions & 0 deletions solution/0100-0199/0152.Maximum Product Subarray/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ tags:

<p>The test cases are generated so that the answer will fit in a <strong>32-bit</strong> integer.</p>

<p><strong>Note</strong> that the product of an array with a single element is the value of that element.</p>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ tags:

<p>对于所有给定的输入,<strong>保证</strong> 答案字符串的长度小于 <code>10<sup>4</sup></code> 。</p>

<p><strong>注意</strong>,如果分数可以表示为有限长度的字符串,则 <strong>必须</strong> 返回它。</p>

<p>&nbsp;</p>

<p><strong>示例 1:</strong></p>
Expand Down
1 change: 1 addition & 0 deletions solution/0200-0299/0218.The Skyline Problem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tags:
- 数组
- 分治
- 有序集合
- 排序
- 扫描线
- 堆(优先队列)
---
Expand Down
1 change: 1 addition & 0 deletions solution/0200-0299/0218.The Skyline Problem/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tags:
- Array
- Divide and Conquer
- Ordered Set
- Sorting
- Line Sweep
- Heap (Priority Queue)
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0300-0399/0352.Data%20Stream%20as%20Disjoint%20Intervals/README.md
tags:
- 并查集
- 设计
- 哈希表
- 二分查找
- 数据流
- 有序集合
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0300-0399/0352.Data%20Stream%20as%20Disjoint%20Intervals/README_EN.md
tags:
- Union Find
- Design
- Hash Table
- Binary Search
- Data Stream
- Ordered Set
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tags:

<p>有一些球形气球贴在一堵用 XY 平面表示的墙面上。墙面上的气球记录在整数数组&nbsp;<code>points</code>&nbsp;,其中<code>points[i] = [x<sub>start</sub>, x<sub>end</sub>]</code>&nbsp;表示水平直径在&nbsp;<code>x<sub>start</sub></code>&nbsp;和&nbsp;<code>x<sub>end</sub></code>之间的气球。你不知道气球的确切 y 坐标。</p>

<p>一支弓箭可以沿着 x 轴从不同点 <strong>完全垂直</strong> 地射出。在坐标 <code>x</code> 处射出一支箭,若有一个气球的直径的开始和结束坐标为 <code>x</code><sub><code>start</code>,</sub><code>x</code><sub><code>end</code>,</sub> 且满足 &nbsp;<code>x<sub>start</sub>&nbsp;≤ x ≤ x</code><sub><code>end</code>,</sub>则该气球会被 <strong>引爆</strong>&nbsp;<sub>。</sub>可以射出的弓箭的数量 <strong>没有限制</strong> 。 弓箭一旦被射出之后,可以无限地前进。</p>
<p>一支弓箭可以沿着 x 轴从不同点 <strong>完全垂直</strong> 地射出。在坐标 <code>x</code> 处射出一支箭,若有一个气球的直径的开始和结束坐标为 <code>x<sub>start</sub></code><sub>,</sub><code>x<sub>end</sub></code><sub>,</sub> 且满足 &nbsp;<code>x<sub>start</sub>&nbsp;≤ x ≤ x<sub>end</sub></code><sub>,</sub>则该气球会被 <strong>引爆</strong>&nbsp;<sub>。</sub>可以射出的弓箭的数量 <strong>没有限制</strong> 。 弓箭一旦被射出之后,可以无限地前进。</p>

<p>给你一个数组 <code>points</code> ,<em>返回引爆所有气球所必须射出的 <strong>最小</strong> 弓箭数&nbsp;</em>。</p>
&nbsp;
Expand Down
4 changes: 2 additions & 2 deletions solution/0400-0499/0457.Circular Array Loop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ tags:
<p>存在一个不含 <code>0</code> 的<strong> 环形 </strong>数组&nbsp;<code>nums</code> ,每个 <code>nums[i]</code> 都表示位于下标 <code>i</code> 的角色应该向前或向后移动的下标个数:</p>

<ul>
<li>如果 <code>nums[i]</code> 是正数,<strong>向前</strong>(下标递增方向)移动 <code>|nums[i]|</code> 步</li>
<li>如果&nbsp;<code>nums[i]</code> 是负数,<strong>向后</strong>(下标递减方向)移动 <code>|nums[i]|</code> 步</li>
<li>如果 <code>nums[i]</code> 是正数,<strong>向前</strong>(下标递增方向)移动 <code>nums[i]</code>&nbsp;步</li>
<li>如果&nbsp;<code>nums[i]</code> 是负数,<strong>向后</strong>(下标递减方向)移动 <code>abs(nums[i])</code>&nbsp;步</li>
</ul>

<p>因为数组是 <strong>环形</strong> 的,所以可以假设从最后一个元素向前移动一步会到达第一个元素,而第一个元素向后移动一步会到达最后一个元素。</p>
Expand Down
2 changes: 1 addition & 1 deletion solution/0400-0499/0457.Circular Array Loop/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tags:

<ul>
<li>If <code>nums[i]</code> is positive, move <code>nums[i]</code> steps <strong>forward</strong>, and</li>
<li>If <code>nums[i]</code> is negative, move <code>nums[i]</code> steps <strong>backward</strong>.</li>
<li>If <code>nums[i]</code> is negative, move <code>abs(nums[i])</code> steps <strong>backward</strong>.</li>
</ul>

<p>Since the array is <strong>circular</strong>, you may assume that moving forward from the last element puts you on the first element, and moving backwards from the first element puts you on the last element.</p>
Expand Down
8 changes: 8 additions & 0 deletions solution/0700-0799/0735.Asteroid Collision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ tags:
<strong>输出:</strong>[10]
<b>解释:</b>2 和 -5 发生碰撞后剩下 -5 。10 和 -5 发生碰撞后剩下 10 。</pre>

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

<pre>
<b>输入:</b>asteroids = [3,5,-6,2,-1,4]
<b>输出:</b>[-6,2,4]
<b>解释:</b>小行星 -6 使小行星 3 和 5 爆炸,然后继续向左移动。在另一边,小行星 2 使小行星 -1 爆炸,然后继续向右移动,没有碰撞小行星 4。
</pre>

<p>&nbsp;</p>

<p><strong>提示:</strong></p>
Expand Down
10 changes: 9 additions & 1 deletion solution/0700-0799/0735.Asteroid Collision/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tags:

<!-- description:start -->

<p>We are given an array <code>asteroids</code> of integers representing asteroids in a row. The indices of the asteriod in the array represent their relative position in space.</p>
<p>We are given an array <code>asteroids</code> of integers representing asteroids in a row. The indices of the asteroid in the array represent their relative position in space.</p>

<p>For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed.</p>

Expand Down Expand Up @@ -49,6 +49,14 @@ tags:
<strong>Explanation:</strong> The 2 and -5 collide resulting in -5. The 10 and -5 collide resulting in 10.
</pre>

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

<pre>
<strong>Input:</strong> asteroids = [3,5,-6,2,-1,4]​​​​​​​
<strong>Output:</strong> [-6,2,4]
<strong>Explanation:</strong> The asteroid -6 makes the asteroid 3 and 5 explode, and then continues going left. On the other side, the asteroid 2 makes the asteroid -1 explode and then continues going right, without reaching asteroid 4.
</pre>

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

Expand Down
5 changes: 3 additions & 2 deletions solution/0700-0799/0756.Pyramid Transition Matrix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0700-0799/0756.Pyramid%20Transition%20Matrix/README.md
tags:
- 位运算
- 深度优先搜索
- 广度优先搜索
- 哈希表
- 字符串
- 回溯
---

<!-- problem:start -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/0700-0799/0756.Pyramid%20Transition%20Matrix/README_EN.md
tags:
- Bit Manipulation
- Depth-First Search
- Breadth-First Search
- Hash Table
- String
- Backtracking
---

<!-- problem:start -->
Expand Down
6 changes: 3 additions & 3 deletions solution/0700-0799/0765.Couples Holding Hands/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tags:

<p><code>n</code> 对情侣坐在连续排列的 <code>2n</code>&nbsp;个座位上,想要牵到对方的手。</p>

<p>人和座位由一个整数数组 <code>row</code> 表示,其中 <code>row[i]</code> 是坐在第 <code>i </code>个座位上的人的 <strong>ID</strong>。情侣们按顺序编号,第一对是&nbsp;<code>(0, 1)</code>,第二对是&nbsp;<code>(2, 3)</code>,以此类推,最后一对是&nbsp;<code>(2n-2, 2n-1)</code>。</p>
<p>人和座位由一个整数数组 <code>row</code> 表示,其中 <code>row[i]</code> 是坐在第 <code>i </code>个座位上的人的 <strong>ID</strong>。情侣们按顺序编号,第一对是&nbsp;<code>(0, 1)</code>,第二对是&nbsp;<code>(2, 3)</code>,以此类推,最后一对是&nbsp;<code>(2n - 2, 2n - 1)</code>。</p>

<p>返回 <em>最少交换座位的次数,以便每对情侣可以并肩坐在一起</em>。 <i>每次</i>交换可选择任意两人,让他们站起来交换座位。</p>

Expand All @@ -33,7 +33,7 @@ tags:
<pre>
<strong>输入:</strong> row = [0,2,1,3]
<strong>输出:</strong> 1
<strong>解释:</strong> 只需要交换row[1]和row[2]的位置即可。
<strong>解释:</strong> 只需要交换第二个人(row[1])和第三个人(row[2]的位置即可。
</pre>

<p><strong>示例 2:</strong></p>
Expand All @@ -53,7 +53,7 @@ tags:
<li><code>2 &lt;= n &lt;= 30</code></li>
<li><code>n</code>&nbsp;是偶数</li>
<li><code>0 &lt;= row[i] &lt; 2n</code></li>
<li><code>row</code>&nbsp;中所有元素均<strong>无重复</strong></li>
<li><code>row</code>&nbsp;中所有元素均&nbsp;<strong>无重复</strong></li>
</ul>

<!-- description:end -->
Expand Down
3 changes: 1 addition & 2 deletions solution/0700-0799/0765.Couples Holding Hands/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ tags:

<ul>
<li><code>2n == row.length</code></li>
<li><code>2 &lt;= n &lt;= 30</code></li>
<li><code>n</code> is even.</li>
<li><code>2 &lt;= n &lt;= 30</code>​​​​​​​</li>
<li><code>0 &lt;= row[i] &lt; 2n</code></li>
<li>All the elements of <code>row</code> are <strong>unique</strong>.</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion solution/0900-0999/0948.Bag of Tokens/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tags:
<pre>
<strong>输入:</strong>tokens = [100], power = 50
<strong>输出:</strong>0
<strong>解释:</strong>因为你的初始分数为 <code>0</code>无法使令牌朝下。你也不能使令牌朝上因为你的能量(<code>50</code>)比 <code>tokens[0]</code>&nbsp;少(<code>100</code>)。</pre>
<strong>解释:</strong>因为你的初始分数为 <code>0</code>无法使令牌朝下。你也不能使令牌朝上因为你的能量(<code>50</code>)比 <code>tokens[0]</code>&nbsp;少(<code>100</code>)。</pre>

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

Expand Down
2 changes: 1 addition & 1 deletion solution/1000-1099/1025.Divisor Game/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ tags:
<p>最初,黑板上有一个数字&nbsp;<code>n</code>&nbsp;。在每个玩家的回合,玩家需要执行以下操作:</p>

<ul>
<li>选出任一&nbsp;<code>x</code>,满足&nbsp;<code>0 &lt; x &lt; n</code>&nbsp;且&nbsp;<code>n % x == 0</code>&nbsp;。</li>
<li>选出任一整数&nbsp;<code>x</code>,满足&nbsp;<code>0 &lt; x &lt; n</code>&nbsp;且&nbsp;<code>n % x == 0</code>&nbsp;。</li>
<li>用 <code>n - x</code>&nbsp;替换黑板上的数字&nbsp;<code>n</code> 。</li>
</ul>

Expand Down
Loading