mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 14:12:17 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个大小为 <code>m * n</code> 的矩阵 <code>mat</code>,矩阵由若干军人和平民组成,分别用 1 和 0 表示。</p>\n\n<p>请你返回矩阵中战斗力最弱的 <code>k</code> 行的索引,按从最弱到最强排序。</p>\n\n<p>如果第 <em><strong>i</strong></em> 行的军人数量少于第 <em><strong>j</strong></em> 行,或者两行军人数量相同但<em><strong> i</strong></em> 小于 <em><strong>j</strong></em>,那么我们认为第<em><strong> i </strong></em>行的战斗力比第<em><strong> j </strong></em>行弱。</p>\n\n<p>军人 <strong>总是</strong> 排在一行中的靠前位置,也就是说 1 总是出现在 0 之前。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>mat = \n[[1,1,0,0,0],\n [1,1,1,1,0],\n [1,0,0,0,0],\n [1,1,0,0,0],\n [1,1,1,1,1]], \nk = 3\n<strong>输出:</strong>[2,0,3]\n<strong>解释:</strong>\n每行中的军人数目:\n行 0 -> 2 \n行 1 -> 4 \n行 2 -> 1 \n行 3 -> 2 \n行 4 -> 5 \n从最弱到最强对这些行排序后得到 [2,0,3,1,4]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>mat = \n[[1,0,0,0],\n [1,1,1,1],\n [1,0,0,0],\n [1,0,0,0]], \nk = 2\n<strong>输出:</strong>[0,2]\n<strong>解释:</strong> \n每行中的军人数目:\n行 0 -> 1 \n行 1 -> 4 \n行 2 -> 1 \n行 3 -> 1 \n从最弱到最强对这些行排序后得到 [0,2,3,1]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>m == mat.length</code></li>\n\t<li><code>n == mat[i].length</code></li>\n\t<li><code>2 <= n, m <= 100</code></li>\n\t<li><code>1 <= k <= m</code></li>\n\t<li><code>matrix[i][j]</code> 不是 0 就是 1</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 142,
|
||||
"likes": 143,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"42.6K\", \"totalSubmission\": \"61K\", \"totalAcceptedRaw\": 42605, \"totalSubmissionRaw\": 60968, \"acRate\": \"69.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"42.8K\", \"totalSubmission\": \"61.2K\", \"totalAcceptedRaw\": 42783, \"totalSubmissionRaw\": 61221, \"acRate\": \"69.9%\"}",
|
||||
"hints": [
|
||||
"Sort the matrix row indexes by the number of soldiers and then row indexes."
|
||||
],
|
||||
|
Reference in New Issue
Block a user