Tap here to switch tabs
Problem
Submissions

Problem: Minimum Absolute Difference

Minimum Absolute Difference asks you to compare distinct elements in an integer array, return every pair with the smallest absolute difference, place the smaller value first, and sort the list.

Statement

Given an integer array arr, find the minimum absolute difference between any two distinct elements. Return a list of all pairs of elements that have this minimum absolute difference.

Each pair must be returned as [x, y] where x < y. The returned list of pairs must be sorted in ascending order.

Constraints:

  • 2≤2 \leq arr.length ≤105\leq 10^5

  • −106≤-10^6 \leq arr[i] ≤106\leq 10^6

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Absolute Difference

Minimum Absolute Difference asks you to compare distinct elements in an integer array, return every pair with the smallest absolute difference, place the smaller value first, and sort the list.

Statement

Given an integer array arr, find the minimum absolute difference between any two distinct elements. Return a list of all pairs of elements that have this minimum absolute difference.

Each pair must be returned as [x, y] where x < y. The returned list of pairs must be sorted in ascending order.

Constraints:

  • 2≤2 \leq arr.length ≤105\leq 10^5

  • −106≤-10^6 \leq arr[i] ≤106\leq 10^6