mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 22:13:28 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>你正在参加一个多角色游戏,每个角色都有两个主要属性:<strong>攻击</strong> 和 <strong>防御</strong> 。给你一个二维整数数组 <code>properties</code> ,其中 <code>properties[i] = [attack<sub>i</sub>, defense<sub>i</sub>]</code> 表示游戏中第 <code>i</code> 个角色的属性。</p>\n\n<p>如果存在一个其他角色的攻击和防御等级 <strong>都严格高于</strong> 该角色的攻击和防御等级,则认为该角色为 <strong>弱角色</strong> 。更正式地,如果认为角色 <code>i</code> <strong>弱于</strong> 存在的另一个角色 <code>j</code> ,那么 <code>attack<sub>j</sub> > attack<sub>i</sub></code> 且 <code>defense<sub>j</sub> > defense<sub>i</sub></code> 。</p>\n\n<p>返回 <strong>弱角色</strong> 的数量。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>properties = [[5,5],[6,3],[3,6]]\n<strong>输出:</strong>0\n<strong>解释:</strong>不存在攻击和防御都严格高于其他角色的角色。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>properties = [[2,2],[3,3]]\n<strong>输出:</strong>1\n<strong>解释:</strong>第一个角色是弱角色,因为第二个角色的攻击和防御严格大于该角色。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>properties = [[1,5],[10,4],[4,3]]\n<strong>输出:</strong>1\n<strong>解释:</strong>第三个角色是弱角色,因为第二个角色的攻击和防御严格大于该角色。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>2 <= properties.length <= 10<sup>5</sup></code></li>\n\t<li><code>properties[i].length == 2</code></li>\n\t<li><code>1 <= attack<sub>i</sub>, defense<sub>i</sub> <= 10<sup>5</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 145,
|
||||
"likes": 146,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"26.3K\", \"totalSubmission\": \"63.6K\", \"totalAcceptedRaw\": 26253, \"totalSubmissionRaw\": 63613, \"acRate\": \"41.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"26.6K\", \"totalSubmission\": \"64.3K\", \"totalAcceptedRaw\": 26627, \"totalSubmissionRaw\": 64332, \"acRate\": \"41.4%\"}",
|
||||
"hints": [
|
||||
"Sort the array on the basis of the attack values and group characters with the same attack together. How can you use these groups?",
|
||||
"Characters in one group will always have a lesser attack value than the characters of the next group. Hence, we will only need to check if there is a higher defense value present in the next groups."
|
||||
|
Reference in New Issue
Block a user