NeetCode #280LC-2616MediumBinary Search
← Back to All Problems

#280 · #2616 · Minimize the Maximum Difference of Pairs(最小化数对的最大差值)

📌 Problem Statement & Constraints

You are given a 0-indexed integer array nums and an integer p. Find p pairs of indices such that no index appears in more than one pair, minimising the maximum difference among the pairs. Return that minimum possible maximum difference. Constraints: 1 <= nums.length <= 10^5, 0 <= nums[i] <= 10^9, 0 <= p <= nums.length / 2.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!