프로그래머스 - 두 개 뽑아서 더하기

yoonene·2021년 12월 17일
0

알고리즘

목록 보기
10/62

python3

from itertools import combinations
def solution(numbers):
    comb = combinations(numbers, 2)
    result = []
    for c in comb:
        result.append(sum(c))
        
    result = list(set(result))
    return sorted(result)
profile
NLP Researcher / Information Retrieval / Search

0개의 댓글