1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 14:12:17 +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> 和一个正整数 <code>k</code> ,返回长度为 <code>k</code> 且最具 <strong>竞争力</strong> 的<em> </em><code>nums</code> 子序列。</p>\n\n<p>数组的子序列是从数组中删除一些元素(可能不删除元素)得到的序列。</p>\n\n<p>在子序列 <code>a</code> 和子序列 <code>b</code> 第一个不相同的位置上,如果 <code>a</code> 中的数字小于 <code>b</code> 中对应的数字,那么我们称子序列 <code>a</code> 比子序列 <code>b</code>(相同长度下)更具 <strong>竞争力</strong> 。 例如,<code>[1,3,4]</code> 比 <code>[1,3,5]</code> 更具竞争力,在第一个不相同的位置,也就是最后一个位置上, <code>4</code> 小于 <code>5</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [3,5,2,6], k = 2\n<strong>输出:</strong>[2,6]\n<strong>解释:</strong>在所有可能的子序列集合 {[3,5], [3,2], [3,6], [5,2], [5,6], [2,6]} 中,[2,6] 最具竞争力。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [2,4,3,3,5,4,9,6], k = 4\n<strong>输出:</strong>[2,3,3,4]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 10<sup>5</sup></code></li>\n\t<li><code>0 <= nums[i] <= 10<sup>9</sup></code></li>\n\t<li><code>1 <= k <= nums.length</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 76,
"likes": 79,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -155,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"8.7K\", \"totalSubmission\": \"23.6K\", \"totalAcceptedRaw\": 8700, \"totalSubmissionRaw\": 23643, \"acRate\": \"36.8%\"}",
"stats": "{\"totalAccepted\": \"9K\", \"totalSubmission\": \"24.3K\", \"totalAcceptedRaw\": 8983, \"totalSubmissionRaw\": 24271, \"acRate\": \"37.0%\"}",
"hints": [
"In lexicographical order, the elements to the left have higher priority than those that come after. Can you think of a strategy that incrementally builds the answer from left to right?"
],