1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-25 23:08:57 +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

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个数组 <code>nums</code>,请你从中抽取一个子序列,满足该子序列的元素之和 <strong>严格</strong> 大于未包含在该子序列中的各元素之和。</p>\n\n<p>如果存在多个解决方案,只需返回 <strong>长度最小</strong> 的子序列。如果仍然有多个解决方案,则返回 <strong>元素之和最大</strong> 的子序列。</p>\n\n<p>与子数组不同的地方在于,「数组的子序列」不强调元素在原数组中的连续性,也就是说,它可以通过从数组中分离一些(也可能不分离)元素得到。</p>\n\n<p><strong>注意</strong>,题目数据保证满足所有约束条件的解决方案是 <strong>唯一</strong> 的。同时,返回的答案应当按 <strong>非递增顺序</strong> 排列。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><strong>输入:</strong>nums = [4,3,10,9,8]\n<strong>输出:</strong>[10,9] \n<strong>解释:</strong>子序列 [10,9] 和 [10,8] 是最小的、满足元素之和大于其他各元素之和的子序列。但是 [10,9] 的元素之和最大。&nbsp;\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><strong>输入:</strong>nums = [4,4,7,6,7]\n<strong>输出:</strong>[7,7,6] \n<strong>解释:</strong>子序列 [7,7] 的和为 14 不严格大于剩下的其他元素之和14 = 4 + 4 + 6。因此[7,6,7] 是满足题意的最小子序列。注意,元素按非递增顺序返回。 \n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre><strong>输入:</strong>nums = [6]\n<strong>输出:</strong>[6]\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= nums.length &lt;= 500</code></li>\n\t<li><code>1 &lt;= nums[i] &lt;= 100</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 45,
"likes": 46,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"23.5K\", \"totalSubmission\": \"34.1K\", \"totalAcceptedRaw\": 23477, \"totalSubmissionRaw\": 34121, \"acRate\": \"68.8%\"}",
"stats": "{\"totalAccepted\": \"23.9K\", \"totalSubmission\": \"34.7K\", \"totalAcceptedRaw\": 23880, \"totalSubmissionRaw\": 34670, \"acRate\": \"68.9%\"}",
"hints": [
"Sort elements and take each element from the largest until accomplish the conditions."
],