Hard
The distance of a pair (a, b) is |a - b|. Given an integer array nums and an integer k, return the k-th smallest distance among all n * (n - 1) / 2 pairs (1-indexed).
Input: nums = [1,3,1], k = 1 Output: 0
Input: nums = [1,1,1], k = 2 Output: 0
Input: nums = [1,6,1], k = 3 Output: 5