mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-21 13:06:47 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>一只青蛙想要过河。 假定河流被等分为若干个单元格,并且在每一个单元格内都有可能放有一块石子(也有可能没有)。 青蛙可以跳上石子,但是不可以跳入水中。</p>\n\n<p>给你石子的位置列表 <code>stones</code>(用单元格序号 <strong>升序</strong> 表示), 请判定青蛙能否成功过河(即能否在最后一步跳至最后一块石子上)。开始时, 青蛙默认已站在第一块石子上,并可以假定它第一步只能跳跃 <code>1</code> 个单位(即只能从单元格 1 跳至单元格 2 )。</p>\n\n<p>如果青蛙上一步跳跃了 <code>k</code><em> </em>个单位,那么它接下来的跳跃距离只能选择为 <code>k - 1</code>、<code>k</code><em> </em>或 <code>k + 1</code> 个单位。 另请注意,青蛙只能向前方(终点的方向)跳跃。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>stones = [0,1,3,5,6,8,12,17]\n<strong>输出:</strong>true\n<strong>解释:</strong>青蛙可以成功过河,按照如下方案跳跃:跳 1 个单位到第 2 块石子, 然后跳 2 个单位到第 3 块石子, 接着 跳 2 个单位到第 4 块石子, 然后跳 3 个单位到第 6 块石子, 跳 4 个单位到第 7 块石子, 最后,跳 5 个单位到第 8 个石子(即最后一块石子)。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>stones = [0,1,2,3,4,8,9,11]\n<strong>输出:</strong>false\n<strong>解释:</strong>这是因为第 5 和第 6 个石子之间的间距太大,没有可选的方案供青蛙跳跃过去。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>2 <= stones.length <= 2000</code></li>\n\t<li><code>0 <= stones[i] <= 2<sup>31</sup> - 1</code></li>\n\t<li><code>stones[0] == 0</code></li>\n\t<li><code>stones</code> 按严格升序排列</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 412,
|
||||
"likes": 413,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"50.2K\", \"totalSubmission\": \"109.9K\", \"totalAcceptedRaw\": 50181, \"totalSubmissionRaw\": 109921, \"acRate\": \"45.7%\"}",
|
||||
"stats": "{\"totalAccepted\": \"50.2K\", \"totalSubmission\": \"110.1K\", \"totalAcceptedRaw\": 50247, \"totalSubmissionRaw\": 110064, \"acRate\": \"45.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user