Sunday, December 10, 2017

561. Array Partition I

class Solution:
    def arrayPairSum(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        new_array = sorted(nums)
        return sum(new_array[::2])

No comments:

Post a Comment