mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 15:01:40 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个整数数组,返回所有数对之间的第 k 个最小<strong>距离</strong>。一对 (A, B) 的距离被定义为 A 和 B 之间的绝对差值。</p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>\nnums = [1,3,1]\nk = 1\n<strong>输出:0</strong> \n<strong>解释:</strong>\n所有数对如下:\n(1,3) -> 2\n(1,1) -> 0\n(3,1) -> 2\n因此第 1 个最小距离的数对是 (1,1),它们之间的距离为 0。\n</pre>\n\n<p><strong>提示:</strong></p>\n\n<ol>\n\t<li><code>2 <= len(nums) <= 10000</code>.</li>\n\t<li><code>0 <= nums[i] < 1000000</code>.</li>\n\t<li><code>1 <= k <= len(nums) * (len(nums) - 1) / 2</code>.</li>\n</ol>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 233,
|
||||
"likes": 237,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Find K Pairs with Smallest Sums\", \"titleSlug\": \"find-k-pairs-with-smallest-sums\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u67e5\\u627e\\u548c\\u6700\\u5c0f\\u7684 K \\u5bf9\\u6570\\u5b57\"}, {\"title\": \"Kth Smallest Element in a Sorted Matrix\", \"titleSlug\": \"kth-smallest-element-in-a-sorted-matrix\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u6709\\u5e8f\\u77e9\\u9635\\u4e2d\\u7b2c K \\u5c0f\\u7684\\u5143\\u7d20\"}, {\"title\": \"Find K Closest Elements\", \"titleSlug\": \"find-k-closest-elements\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u627e\\u5230 K \\u4e2a\\u6700\\u63a5\\u8fd1\\u7684\\u5143\\u7d20\"}, {\"title\": \"Kth Smallest Number in Multiplication Table\", \"titleSlug\": \"kth-smallest-number-in-multiplication-table\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u4e58\\u6cd5\\u8868\\u4e2d\\u7b2ck\\u5c0f\\u7684\\u6570\"}, {\"title\": \"K-th Smallest Prime Fraction\", \"titleSlug\": \"k-th-smallest-prime-fraction\", \"difficulty\": \"Hard\", \"translatedTitle\": \"\\u7b2c K \\u4e2a\\u6700\\u5c0f\\u7684\\u7d20\\u6570\\u5206\\u6570\"}]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"11.1K\", \"totalSubmission\": \"28.8K\", \"totalAcceptedRaw\": 11076, \"totalSubmissionRaw\": 28848, \"acRate\": \"38.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"11.5K\", \"totalSubmission\": \"29.7K\", \"totalAcceptedRaw\": 11472, \"totalSubmissionRaw\": 29740, \"acRate\": \"38.6%\"}",
|
||||
"hints": [
|
||||
"Binary search for the answer. How can you check how many pairs have distance <= X?"
|
||||
],
|
||||
|
Reference in New Issue
Block a user