mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-10-24 22:38:57 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>环形公交路线上有 <code>n</code> 个站,按次序从 <code>0</code> 到 <code>n - 1</code> 进行编号。我们已知每一对相邻公交站之间的距离,<code>distance[i]</code> 表示编号为 <code>i</code> 的车站和编号为 <code>(i + 1) % n</code> 的车站之间的距离。</p>\n\n<p>环线上的公交车都可以按顺时针和逆时针的方向行驶。</p>\n\n<p>返回乘客从出发点 <code>start</code> 到目的地 <code>destination</code> 之间的最短距离。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/09/08/untitled-diagram-1.jpg\" style=\"height: 240px; width: 388px;\"></p>\n\n<pre><strong>输入:</strong>distance = [1,2,3,4], start = 0, destination = 1\n<strong>输出:</strong>1\n<strong>解释:</strong>公交站 0 和 1 之间的距离是 1 或 9,最小值是 1。</pre>\n\n<p> </p>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/09/08/untitled-diagram-1-1.jpg\" style=\"height: 240px; width: 388px;\"></p>\n\n<pre><strong>输入:</strong>distance = [1,2,3,4], start = 0, destination = 2\n<strong>输出:</strong>3\n<strong>解释:</strong>公交站 0 和 2 之间的距离是 3 或 7,最小值是 3。\n</pre>\n\n<p> </p>\n\n<p><strong>示例 3:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/09/08/untitled-diagram-1-2.jpg\" style=\"height: 240px; width: 388px;\"></p>\n\n<pre><strong>输入:</strong>distance = [1,2,3,4], start = 0, destination = 3\n<strong>输出:</strong>4\n<strong>解释:</strong>公交站 0 和 3 之间的距离是 6 或 4,最小值是 4。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 10^4</code></li>\n\t<li><code>distance.length == n</code></li>\n\t<li><code>0 <= start, destination < n</code></li>\n\t<li><code>0 <= distance[i] <= 10^4</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 49,
|
||||
"likes": 50,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -137,7 +137,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"15.2K\", \"totalSubmission\": \"26K\", \"totalAcceptedRaw\": 15165, \"totalSubmissionRaw\": 26023, \"acRate\": \"58.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"15.6K\", \"totalSubmission\": \"26.8K\", \"totalAcceptedRaw\": 15627, \"totalSubmissionRaw\": 26759, \"acRate\": \"58.4%\"}",
|
||||
"hints": [
|
||||
"Find the distance between the two stops if the bus moved in clockwise or counterclockwise directions."
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user