mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 15:31:43 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个 <strong>排序好</strong> 的数组 <code>arr</code> ,两个整数 <code>k</code> 和 <code>x</code> ,从数组中找到最靠近 <code>x</code>(两数之差最小)的 <code>k</code> 个数。返回的结果必须要是按升序排好的。</p>\n\n<p>整数 <code>a</code> 比整数 <code>b</code> 更接近 <code>x</code> 需要满足:</p>\n\n<ul>\n\t<li><code>|a - x| < |b - x|</code> 或者</li>\n\t<li><code>|a - x| == |b - x|</code> 且 <code>a < b</code></li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [1,2,3,4,5], k = 4, x = 3\n<strong>输出:</strong>[1,2,3,4]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [1,2,3,4,5], k = 4, x = -1\n<strong>输出:</strong>[1,2,3,4]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= k <= arr.length</code></li>\n\t<li><code>1 <= arr.length <= 10<sup>4</sup></code><meta charset=\"UTF-8\" /></li>\n\t<li><code>arr</code> 按 <strong>升序</strong> 排列</li>\n\t<li><code>-10<sup>4</sup> <= arr[i], x <= 10<sup>4</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 304,
|
||||
"likes": 313,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Guess Number Higher or Lower\", \"titleSlug\": \"guess-number-higher-or-lower\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u731c\\u6570\\u5b57\\u5927\\u5c0f\"}, {\"title\": \"Guess Number Higher or Lower II\", \"titleSlug\": \"guess-number-higher-or-lower-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u731c\\u6570\\u5b57\\u5927\\u5c0f II\"}, {\"title\": \"Find K-th Smallest Pair Distance\", \"titleSlug\": \"find-k-th-smallest-pair-distance\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u627e\\u51fa\\u7b2c k \\u5c0f\\u7684\\u8ddd\\u79bb\\u5bf9\"}]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"34.3K\", \"totalSubmission\": \"75.2K\", \"totalAcceptedRaw\": 34276, \"totalSubmissionRaw\": 75181, \"acRate\": \"45.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"36.5K\", \"totalSubmission\": \"79.9K\", \"totalAcceptedRaw\": 36455, \"totalSubmissionRaw\": 79861, \"acRate\": \"45.6%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user