Find K-th Smallest Pair Distance at Google

Hard46.3% acceptance

This problem has 25.0% frequency at Google.

Problem Description

The **distance of a pair** of integers `a` and `b` is defined as the absolute difference between `a` and `b`. Given an integer array `nums` and an integer `k`, return _the_ `kth` _smallest**distance among all the pairs**_ `nums[i]` _and_ `nums[j]` _where_ `0 <= i < j < nums.length`.

Read full problem and hints

Topics

Also asked at 3 companies


More Google Questions

View all Google questions