class Solution:
def arrayPairSum(self, nums: List[int]) -> int:
return sum([x for x in sorted(nums)[::2]])
'자료구조와 알고리즘' 카테고리의 다른 글
234. Palindrome Linked List(팰린드롬 연결 리스트) (0) | 2023.02.05 |
---|---|
121. Best Time to Buy and Sell Stock(주식을 사고팔기 가장 좋은 시점) (0) | 2023.02.03 |
238. Product of Array Except self(자신을 제외한 배열의 곱) (0) | 2023.02.03 |
15. 3Sum(세 수의 합) (0) | 2023.02.02 |
1. Two Sum(두 수의 합) (0) | 2023.02.02 |