Solving Find K th Smallest Pair Distance in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Example 1:

Input:
nums = [1,3,1]
k = 1
Output: 0 
Explanation:
Here are all the pairs:
(1,3) -> 2
(1,1) -> 0
(3,1) -> 2
Then the 1st smallest distance pair is (1,1), and its distance is 0.

Note:

  1. 2 <= len(nums) <= 10000.

  2. 0 <= nums[i] < 1000000.

  3. 1 <= k <= len(nums) * (len(nums) - 1) / 2.

  4. 2 <= len(nums) <= 10000.

  5. 0 <= nums[i] < 1000000.

  6. 1 <= k <= len(nums) * (len(nums) - 1) / 2.

See the full details of the problem Find K th Smallest Pair Distance at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go