mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-25 23:08:57 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>这里有一个非负整数数组 <code>arr</code>,你最开始位于该数组的起始下标 <code>start</code> 处。当你位于下标 <code>i</code> 处时,你可以跳到 <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> </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 -> 下标 4 -> 下标 1 -> 下标 3 \n下标 5 -> 下标 6 -> 下标 4 -> 下标 1 -> 下标 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 -> 下标 4 -> 下标 1 -> 下标 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> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= arr.length <= 5 * 10^4</code></li>\n\t<li><code>0 <= arr[i] < arr.length</code></li>\n\t<li><code>0 <= start < 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."
|
||||
|
||||
Reference in New Issue
Block a user