LovePinkLol-Python Programming
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment