프로그래머스 연습문제: 두 개 뽑아서 더하기 (python)


프로그래머스 연습문제: 두 개 뽑아서 더하기 (python)

from itertools import combinations def solution(numbers): s = set() for x in combinations(numbers, 2): s.add(sum(x)) answer = sorted(list(s)) return answer combinations를 썼지만 이거를 쓰지 않고 이중 for문으로 돌아서 풀어도 쉽게 풀린다.

프로그래머스 연습문제: 두 개 뽑아서 더하기 (python)에 대한 요약내용입니다.

자세한 내용은 아래에 원문링크를 확인해주시기 바랍니다.


원문링크 : 프로그래머스 연습문제: 두 개 뽑아서 더하기 (python)