def arrayPairSum(self, nums: List[int]) -> int:
nums.sort()
res = 0
for i in range(0, len(nums), 2):
res += nums[i]
return res
'알고리즘' 카테고리의 다른 글
<백준> 5525번 파이썬 알고리즘 (0) | 2021.11.28 |
---|---|
<백준> 5430번 파이썬 알고리즘 (0) | 2021.11.27 |
<리트코드> 42번 파이썬 알고리즘 [투 포인터] (0) | 2021.11.24 |
<백준> 2579번 파이썬 알고리즘 [동적 프로그래밍] (0) | 2021.11.20 |
<백준> 1629번 파이썬 알고리즘 [분할정복] (0) | 2021.11.12 |