Tap here to switch tabs
Problem
Submissions

Problem: Minimize Maximum Pair Sum in Array

med
30 min
Try to solve the Minimize Maximum Pair Sum in Array problem.

Statement

The pair sum of a pair (a,b)(a, b) is defined as a+ba + b. The maximum pair sum is the largest sum among a given set of pairs.

Given an integer array nums of an even length n, group the elements of nums into n2\frac{n}{2} pairs such that:

  • Every element in nums belongs to exactly 11 pair.

  • The maximum pair sum among all formed pairs is minimized.

Return the minimized maximum pair sum.

Constraints:

  • n ==== nums.length

  • 2≤2 \leq n ≤105\leq 10^5

  • n is even.

  • 1≤1 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimize Maximum Pair Sum in Array

med
30 min
Try to solve the Minimize Maximum Pair Sum in Array problem.

Statement

The pair sum of a pair (a,b)(a, b) is defined as a+ba + b. The maximum pair sum is the largest sum among a given set of pairs.

Given an integer array nums of an even length n, group the elements of nums into n2\frac{n}{2} pairs such that:

  • Every element in nums belongs to exactly 11 pair.

  • The maximum pair sum among all formed pairs is minimized.

Return the minimized maximum pair sum.

Constraints:

  • n ==== nums.length

  • 2≤2 \leq n ≤105\leq 10^5

  • n is even.

  • 1≤1 \leq nums[i] ≤105\leq 10^5