1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 15:31:43 +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

@@ -2,7 +2,7 @@
"data": {
"question": {
"questionId": "1354",
"questionFrontendId": "5235",
"questionFrontendId": "2225",
"categoryTitle": "Algorithms",
"boundTopicId": 1385504,
"title": "Find Players With Zero or One Losses",
@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个整数数组 <code>matches</code> 其中 <code>matches[i] = [winner<sub>i</sub>, loser<sub>i</sub>]</code> 表示在一场比赛中 <code>winner<sub>i</sub></code> 击败了 <code>loser<sub>i</sub></code> 。</p>\n\n<p>返回一个长度为 2 的列表<em> </em><code>answer</code> </p>\n\n<ul>\n\t<li><code>answer[0]</code> 是所有 <strong>没有</strong> 输掉任何比赛的玩家列表。</li>\n\t<li><code>answer[1]</code> 是所有恰好输掉 <strong>一场</strong> 比赛的玩家列表。</li>\n</ul>\n\n<p>两个列表中的值都应该按 <strong>递增</strong> 顺序返回。</p>\n\n<p><strong>注意:</strong></p>\n\n<ul>\n\t<li>只考虑那些参与 <strong>至少一场</strong> 比赛的玩家。</li>\n\t<li>生成的测试用例保证 <strong>不存在</strong> 两场比赛结果 <strong>相同</strong> 。</li>\n</ul>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>matches = [[1,3],[2,3],[3,6],[5,6],[5,7],[4,5],[4,8],[4,9],[10,4],[10,9]]\n<strong>输出:</strong>[[1,2,10],[4,5,7,8]]\n<strong>解释:</strong>\n玩家 1、2 和 10 都没有输掉任何比赛。\n玩家 4、5、7 和 8 每个都输掉一场比赛。\n玩家 3、6 和 9 每个都输掉两场比赛。\n因此answer[0] = [1,2,10] 和 answer[1] = [4,5,7,8] 。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>matches = [[2,3],[1,3],[5,4],[6,4]]\n<strong>输出:</strong>[[1,2,5,6],[]]\n<strong>解释:</strong>\n玩家 1、2、5 和 6 都没有输掉任何比赛。\n玩家 3 和 4 每个都输掉两场比赛。\n因此answer[0] = [1,2,5,6] 和 answer[1] = [] 。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= matches.length &lt;= 10<sup>5</sup></code></li>\n\t<li><code>matches[i].length == 2</code></li>\n\t<li><code>1 &lt;= winner<sub>i</sub>, loser<sub>i</sub> &lt;= 10<sup>5</sup></code></li>\n\t<li><code>winner<sub>i</sub> != loser<sub>i</sub></code></li>\n\t<li>所有 <code>matches[i]</code> <strong>互不相同</strong></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 2,
"likes": 5,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -20,9 +20,27 @@
"langToValidPlayground": "{\"cpp\": false, \"java\": true, \"python\": true, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false}",
"topicTags": [
{
"name": "Graph",
"slug": "graph",
"translatedName": "",
"name": "Array",
"slug": "array",
"translatedName": "数组",
"__typename": "TopicTagNode"
},
{
"name": "Hash Table",
"slug": "hash-table",
"translatedName": "哈希表",
"__typename": "TopicTagNode"
},
{
"name": "Counting",
"slug": "counting",
"translatedName": "计数",
"__typename": "TopicTagNode"
},
{
"name": "Sorting",
"slug": "sorting",
"translatedName": "排序",
"__typename": "TopicTagNode"
}
],
@@ -137,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"6K\", \"totalSubmission\": \"9.7K\", \"totalAcceptedRaw\": 6010, \"totalSubmissionRaw\": 9714, \"acRate\": \"61.9%\"}",
"stats": "{\"totalAccepted\": \"8.1K\", \"totalSubmission\": \"12.9K\", \"totalAcceptedRaw\": 8064, \"totalSubmissionRaw\": 12897, \"acRate\": \"62.5%\"}",
"hints": [
"Count the number of times a player loses while iterating through the matches."
],