Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 재귀
- 스택
- 수학
- programmers
- dict
- 파이썬
- 프로그래머스
- N과M
- 운영체제
- 딕셔너리
- BOJ
- 백준
- 다익스트라
- dfs
- 브루트포스
- 코딩테스트
- DP
- 그리디
- 가상메모리
- 힙
- BFS
- level1
- 다이나믹 프로그래밍
- 가상메모리 관리
- level3
- 구현
- python
- MYSQL
- level0
- level2
Archives
- Today
- Total
동캄의 코딩도장
프로그래머스 level1 [삼총사] 파이썬 본문
https://school.programmers.co.kr/learn/courses/30/lessons/131705
# 프로그래머스 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 |