1 parent 530aeb5 commit 8a89768Copy full SHA for 8a89768
2 files changed
프로그래머스/1/68644. 두 개 뽑아서 더하기/README.md
@@ -1,10 +1,10 @@
1
# [level 1] 두 개 뽑아서 더하기 - 68644
2
3
-[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/68644?language=python3)
+[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/68644)
4
5
### 성능 요약
6
7
-메모리: 9.21 MB, 시간: 1.00 ms
+메모리: 11.6 MB, 시간: 0.29 ms
8
9
### 구분
10
@@ -16,7 +16,7 @@
16
17
### 제출 일자
18
19
-2026년 04월 03일 22:49:10
+2026년 07월 26일 15:20:24
20
21
### 문제 설명
22
프로그래머스/1/68644. 두 개 뽑아서 더하기/두 개 뽑아서 더하기.py
@@ -1,9 +1,7 @@
+from itertools import combinations
+
def solution(numbers):
ans = set()
- for i in range(len(numbers)):
- for j in range(len(numbers)):
- if i == j:
- pass
- else:
- ans.add(numbers[i] + numbers[j])
- return sorted(list(ans))
+ for i in combinations(numbers, 2):
+ ans.add(sum(i))
+ return sorted(ans)
0 commit comments