mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 08:21:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>假设有 <code>n</code><strong> </strong>台超级洗衣机放在同一排上。开始的时候,每台洗衣机内可能有一定量的衣服,也可能是空的。</p>\n\n<p>在每一步操作中,你可以选择任意 <code>m</code> (<code>1 <= m <= n</code>) 台洗衣机,与此同时将每台洗衣机的一件衣服送到相邻的一台洗衣机。</p>\n\n<p>给定一个整数数组 <code>machines</code> 代表从左至右每台洗衣机中的衣物数量,请给出能让所有洗衣机中剩下的衣物的数量相等的 <strong>最少的操作步数 </strong>。如果不能使每台洗衣机中衣物的数量相等,则返回 <code>-1</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>machines = [1,0,5]\n<strong>输出:</strong>3\n<strong>解释:</strong>\n第一步: 1 0 <-- 5 => 1 1 4\n第二步: 1 <-- 1 <-- 4 => 2 1 3 \n第三步: 2 1 <-- 3 => 2 2 2 \n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>machines = [0,3,0]\n<strong>输出:</strong>2\n<strong>解释:</strong>\n第一步: 0 <-- 3 0 => 1 2 0 \n第二步: 1 2 --> 0 => 1 1 1 \n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>machines = [0,2,0]\n<strong>输出:</strong>-1\n<strong>解释:</strong>\n不可能让所有三个洗衣机同时剩下相同数量的衣物。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>n == machines.length</code></li>\n\t<li><code>1 <= n <= 10<sup>4</sup></code></li>\n\t<li><code>0 <= machines[i] <= 10<sup>5</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 216,
|
||||
"likes": 219,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"20.7K\", \"totalSubmission\": \"40.6K\", \"totalAcceptedRaw\": 20662, \"totalSubmissionRaw\": 40558, \"acRate\": \"50.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"21K\", \"totalSubmission\": \"41.2K\", \"totalAcceptedRaw\": 20997, \"totalSubmissionRaw\": 41163, \"acRate\": \"51.0%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user