[Python]ํ๋ก๊ทธ๋๋จธ์ค - ์ผ์ด์ฌ
https://school.programmers.co.kr/learn/courses/30/lessons/131705
ํ๋ก๊ทธ๋๋จธ์ค
์ฝ๋ ์ค์ฌ์ ๊ฐ๋ฐ์ ์ฑ์ฉ. ์คํ ๊ธฐ๋ฐ์ ํฌ์ง์ ๋งค์นญ. ํ๋ก๊ทธ๋๋จธ์ค์ ๊ฐ๋ฐ์ ๋ง์ถคํ ํ๋กํ์ ๋ฑ๋กํ๊ณ , ๋์ ๊ธฐ์ ๊ถํฉ์ด ์ ๋ง๋ ๊ธฐ์ ๋ค์ ๋งค์นญ ๋ฐ์ผ์ธ์.
programmers.co.kr
from itertools import combinations
def solution(number):
answer = 0
combis = list(combinations(number, 3))
for combi in combis:
if sum(combi) == 0:
answer+=1
return answer
'Problem Solving > PROGRAMMERS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[python]ํ๋ก๊ทธ๋๋จธ์ค - ๋ค๋ฆฌ๋ฅผ ์ง๋๋ ํธ๋ญ (0) | 2022.10.29 |
---|---|
[JavaScript] ํ๋ก๊ทธ๋๋จธ์ค - ์ ๊ท์์ด๋ (0) | 2022.10.26 |
[python]ํ๋ก๊ทธ๋๋จธ์ค-์ฝ๋ผ ๋ฌธ์ (0) | 2022.10.24 |
[javascript]ํ๋ก๊ทธ๋๋จธ์ค - k์ง์์์ ์์ ๊ฐ์ ๊ตฌํ๊ธฐ (0) | 2022.09.28 |
[python] ํ๋ก๊ทธ๋๋จธ์ค - ๋ก๋์ ์ต๊ณ ์์์ ์ต์ ์์ (0) | 2022.09.20 |
๋๊ธ