Minimum Difference
Given a set of distinct measurements taken at different times, find the minimum possible difference between any two measurements. Print all pairs of measurements that have this minimum difference in ascending order, with the pairs' difference in ascending order, e.g., if a < b, the pair elements ordered ascending, e.g., if a < b, the pair is a b. The values should have a single space between them.
Complete the function minimumDifference in the editor.
minimumDifference has the following parameter:
int measurements[n]: an array of integers
1Example 1
The minimum absolute difference is 3, and the pairs with that difference are (3,6) and (0,3). When printing element pairs (i,j), they should be ordered ascending first by i and then by j.
Constraints
Limits and guarantees your solution can rely on.
๐๐