알고리즘

[Leetcode] Array Partition I

망나 2020. 8. 29. 10:37

Problem)

 

Solution)

class Solution:
    def arrayPairSum(self, nums: List[int]) -> int:
        return sum(sorted(nums)[::2])

'알고리즘' 카테고리의 다른 글

[Leetcode] Diagonal Traverse  (0) 2020.08.30
[Leetcode] Subarray Sum Equals K  (0) 2020.08.25
[ Leetcode ] Trapping Rain Water  (0) 2020.08.24
[LeetCode] Two Sum  (0) 2020.08.20
[Leetcode] Reverse String  (0) 2020.08.19