Search⌘ K
AI Features

Solution: Find K-th Smallest Pair Distance

Solution: Find K-th Smallest Pair Distance asks you to return the k-th smallest absolute difference among all pairs formed from two different positions in an integer array.

Statement

Given an array of integers nums and an integer k, return the kthk^{th} smallest distance between any pair of integers (nums[i], nums[j]), where 0≤0 \leq i < ...