1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-25 23:08:57 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>这里有一个非负整数数组&nbsp;<code>arr</code>,你最开始位于该数组的起始下标&nbsp;<code>start</code>&nbsp;处。当你位于下标&nbsp;<code>i</code>&nbsp;处时,你可以跳到&nbsp;<code>i + arr[i]</code> 或者 <code>i - arr[i]</code>。</p>\n\n<p>请你判断自己是否能够跳到对应元素值为 0 的 <strong>任一</strong> 下标处。</p>\n\n<p>注意,不管是什么情况下,你都无法跳到数组之外。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><strong>输入:</strong>arr = [4,2,3,0,3,1,2], start = 5\n<strong>输出:</strong>true\n<strong>解释:</strong>\n到达值为 0 的下标 3 有以下可能方案: \n下标 5 -&gt; 下标 4 -&gt; 下标 1 -&gt; 下标 3 \n下标 5 -&gt; 下标 6 -&gt; 下标 4 -&gt; 下标 1 -&gt; 下标 3 \n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><strong>输入:</strong>arr = [4,2,3,0,3,1,2], start = 0\n<strong>输出:</strong>true \n<strong>解释:\n</strong>到达值为 0 的下标 3 有以下可能方案: \n下标 0 -&gt; 下标 4 -&gt; 下标 1 -&gt; 下标 3\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre><strong>输入:</strong>arr = [3,0,2,1,2], start = 2\n<strong>输出:</strong>false\n<strong>解释:</strong>无法到达值为 0 的下标 1 处。 \n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= arr.length &lt;= 5 * 10^4</code></li>\n\t<li><code>0 &lt;= arr[i] &lt;&nbsp;arr.length</code></li>\n\t<li><code>0 &lt;= start &lt; arr.length</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 110,
"likes": 111,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"21.6K\", \"totalSubmission\": \"37.2K\", \"totalAcceptedRaw\": 21604, \"totalSubmissionRaw\": 37231, \"acRate\": \"58.0%\"}",
"stats": "{\"totalAccepted\": \"22.5K\", \"totalSubmission\": \"38.8K\", \"totalAcceptedRaw\": 22547, \"totalSubmissionRaw\": 38834, \"acRate\": \"58.1%\"}",
"hints": [
"Think of BFS to solve the problem.",
"When you reach a position with a value = 0 then return true."