반응형
Notice
Recent Posts
Recent Comments
Link
동캄의 코딩도장
프로그래머스 level1 [삼총사] 파이썬 본문
반응형
https://school.programmers.co.kr/learn/courses/30/lessons/131705
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
# 프로그래머스 level1 삼총사
from itertools import combinations
def solution(number):
answer = 0
combi=combinations(number,3)
for c in combi:
if sum(c)==0:
answer+=1
return answer
combinations 라이브러리를 이용하여 해결하였다.
반응형
'코테 > 프로그래머스' 카테고리의 다른 글
프로그래머스 level1 [콜라 문제] 파이썬 (0) | 2023.04.04 |
---|---|
프로그래머스 level1 [크기가 작은 부분 문자열] 파이썬 (0) | 2023.04.04 |
프로그래머스 level1 [둘만의 암호] 파이썬 (0) | 2023.03.18 |
프로그래머스 level1 [개인정보 수집 유효기간] 파이썬 (0) | 2023.03.16 |
프로그래머스 level1 [대충만든자판] 파이썬 (0) | 2023.03.12 |