[프로그래머스] 86051. 없는 숫자 더하기

devdev·2021년 9월 28일
0

문제 링크

[프로그래머스] 86051. 없는 숫자 더하기

풀이 과정

0부터 9까지 숫자 합 45에서, numbers로 주어진 숫자들의 합을 빼면 정답이 된다.

코드

def solution(numbers):
    return 45 - sum(numbers)


print(solution([1, 2, 3, 4, 6, 7, 8, 0]))
print(solution([5, 8, 4, 0, 6, 7, 9]))
profile
프론트 개발 지망생

0개의 댓글