1877. Minimize Maximum Pair Sum in Array

Обновлено: 2024-03-12
1 мин
[]

Содержание

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]))