Solution: Find K-th Smallest Pair Distance
Let’s solve the Find K-th Smallest Pair Distance problem using the Sort and Search pattern.
We'll cover the following...
Statement
Given an array of integers nums
and an integer k
, return the nums[i]
, nums[j]
), where i
j
num.length
.
The distance between a pair of integers,
and , is defined as the absolute difference between them.
Constraints:
nums.length
nums[i]
...
Access this course and 1400+ top-rated courses and projects.