This repository was archived by the owner on Sep 22, 2021. It is now read-only.

Description
Description of the Problem
First, given array is sorted. And the sum was obtained by increasing the index of the array by two. That is sum of min(ai, bi) at problem.
Code
class Solution:
def arrayPairSum(self, nums: List[int]) -> int:
return sum(sorted(nums)[::2])
Link To The LeetCode Problem
LeetCode