mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 23:11:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你两个整数 <code>n</code> 和 <code>k</code> ,请你构造一个答案列表 <code>answer</code> ,该列表应当包含从 <code>1</code> 到 <code>n</code> 的 <code>n</code> 个不同正整数,并同时满足下述条件:</p>\n\n<ul>\n\t<li>假设该列表是 <code>answer = [a<sub>1</sub>, a<sub>2</sub>, a<sub>3</sub>, ... , a<sub>n</sub>]</code> ,那么列表 <code>[|a<sub>1</sub> - a<sub>2</sub>|, |a<sub>2</sub> - a<sub>3</sub>|, |a<sub>3</sub> - a<sub>4</sub>|, ... , |a<sub>n-1</sub> - a<sub>n</sub>|]</code> 中应该有且仅有 <code>k</code> 个不同整数。</li>\n</ul>\n\n<p>返回列表 <code>answer</code> 。如果存在多种答案,只需返回其中 <strong>任意一种</strong> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 3, k = 1\n<strong>输出:</strong>[1, 2, 3]\n<strong>解释:</strong>[1, 2, 3] 包含 3 个范围在 1-3 的不同整数,并且 [1, 1] 中有且仅有 1 个不同整数:1\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 3, k = 2\n<strong>输出:</strong>[1, 3, 2]\n<strong>解释:</strong>[1, 3, 2] 包含 3 个范围在 1-3 的不同整数,并且 [2, 1] 中有且仅有 2 个不同整数:1 和 2\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= k < n <= 10<sup>4</sup></code></li>\n</ul>\n\n<p> </p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 104,
|
||||
"likes": 106,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Beautiful Arrangement\", \"titleSlug\": \"beautiful-arrangement\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u4f18\\u7f8e\\u7684\\u6392\\u5217\"}]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9.1K\", \"totalSubmission\": \"14.6K\", \"totalAcceptedRaw\": 9077, \"totalSubmissionRaw\": 14563, \"acRate\": \"62.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"9.3K\", \"totalSubmission\": \"15K\", \"totalAcceptedRaw\": 9311, \"totalSubmissionRaw\": 14970, \"acRate\": \"62.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user