MEESHO SUPPLY Hiring | Minimum Absolute Difference |Off-Campus OA (2021)
Meesho · Question · Posted Jun 2026
Problem Statement Given an array of distinct integers, find all pairs of elements with the minimum absolute difference. Return the list of pairs in ascending order. Example Input arr = [4,2,1,3] Output [[1,2],[2,3],[3,4]] Explanation After sorting: [1,2,3,4] Differences: 2 - 1 = 1 3 - 2 = 1 4 - 3 = 1 Minimum difference = 1 Pairs having minimum difference: [[1,2],[2,3],[3,4]] Constraints 2 <= arr.length <= 10^5 -10^6 <= arr[i] <= 10^6 All elements are distinct
The full answer & interview discussion are available to premium members.
Log in Create a free account