1877. Minimize Maximum Pair Sum in Array

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1877

class Solution:
    def minPairSum(self, nums: List[int]) -> int:
        nums.sort()
        n = len(nums)
        return max(x + nums[n - i - 1] for i, x in enumerate(nums[: n >> 1]))