All prompts are owned by LeetCode. To view the prompt, click the title link above.
First completed : June 23, 2024
Last updated : June 23, 2024
Related Topics : Array, Two Pointers, Greedy, Sorting
Acceptance Rate : 81.446 %
class Solution:
def minPairSum(self, nums: List[int]) -> int:
nums.sort()
maxx = 0
for i in range(len(nums) // 2) :
maxx = max(maxx, nums[i] + nums[len(nums) - i - 1])
return maxx