Loading Company...
This is a verified interview question from Ms-(microsoft). Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Closest Numbers" covers key patterns like Arrays.
"### Problem Given an array of distinct integers, determine the minimum absolute difference between any two elements. Print all pairs of elements with that difference, ensuring the smaller number appears first in each pair, and the pairs are sorted in ascending order. ### Input - An array of distinct integers. ### Output - Pairs of elements with the minimum absolute difference, sorted in ascending order. ### Constraints - 2 ≤ n ≤ 10^5 - -10^9 ≤ numbers[i] ≤ 10^9"
Join thousands of developers practicing for Ms-(microsoft).