Skip to content

Commit 8a89768

Browse files
committed
[level 1] Title: 두 개 뽑아서 더하기, Time: 0.29 ms, Memory: 11.6 MB -BaekjoonHub
1 parent 530aeb5 commit 8a89768

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

프로그래머스/1/68644. 두 개 뽑아서 더하기/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# [level 1] 두 개 뽑아서 더하기 - 68644
22

3-
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/68644?language=python3)
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/68644)
44

55
### 성능 요약
66

7-
메모리: 9.21 MB, 시간: 1.00 ms
7+
메모리: 11.6 MB, 시간: 0.29 ms
88

99
### 구분
1010

@@ -16,7 +16,7 @@
1616

1717
### 제출 일자
1818

19-
2026년 04월 03일 22:49:10
19+
2026년 07월 26일 15:20:24
2020

2121
### 문제 설명
2222

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1+
from itertools import combinations
2+
13
def solution(numbers):
24
ans = set()
3-
for i in range(len(numbers)):
4-
for j in range(len(numbers)):
5-
if i == j:
6-
pass
7-
else:
8-
ans.add(numbers[i] + numbers[j])
9-
return sorted(list(ans))
5+
for i in combinations(numbers, 2):
6+
ans.add(sum(i))
7+
return sorted(ans)

0 commit comments

Comments
 (0)