Problem
Minimum Absolute Difference Pairs
Learn this problemProblem statement
Given an integer array nums, find every pair of values whose absolute difference is equal to the minimum absolute difference among any two elements in the array.
Return the pairs with each pair written in ascending order. Return the list of pairs sorted by the first value in each pair, then by the second value.
Function
minimumAbsoluteDifferencePairs(nums: int[]) → int[][]Examples
Example 1
nums = [4, 2, 10, 3, 5]return = [[2,3],[3,4],[4,5]]After sorting the values as [2,3,4,5,10], the minimum absolute difference is 1. The pairs with that difference are [2,3], [3,4], and [4,5].
Constraints
The source post did not specify numeric constraints.
More Agoda problems
- Feasibility of Printing Within Given DaysONSITE INTERVIEW · Seen May 2026
- Minimum Daily Printing LimitONSITE INTERVIEW · Seen May 2026
- 3SumONSITE INTERVIEW · Seen May 2026
- Count One Groups by SizeOA · Seen Jul 2025
- Minimum Price With Discount CouponsOA · Seen Jul 2025
- Lexicographically Smallest Task QueueOA · Seen Jul 2025
- Team FormationOA · Seen Apr 2025
- Two-Core Process AssignmentOA · Seen Apr 2025