Back to problems

Minimum Absolute Difference Pairs

Algorithm · Tesla · Medium

In a distributed system, you often monitor network latency values to identify delays that are closely matched. Given an integer array latencies representing a collection of observed latency measurements, your task is to find every pair of elements whose absolute difference is equal to the minimum absolute difference across all possible pairs in the array. Each returned pair must be formatted as [a, b] with $$a \le b$$. The final list of pairs should be sorted in ascending…

Checking your access…