diff --git "a/yongjun-0903/\354\213\234\354\206\214 \354\247\235\352\277\215.py" "b/yongjun-0903/\354\213\234\354\206\214 \354\247\235\352\277\215.py" new file mode 100644 index 0000000..468965f --- /dev/null +++ "b/yongjun-0903/\354\213\234\354\206\214 \354\247\235\352\277\215.py" @@ -0,0 +1,17 @@ +from itertools import combinations +from math import gcd + +def solution(weights): + answer = 0 + combs = list(combinations(weights, 2)) + siso = [2, 3, 4] + + for comb in combs: + if comb[0] == comb[1]: + answer += 1 + else: + x = gcd(comb[0], comb[1]) + if comb[0] // x and comb[1] // x in siso: + answer += 1 + + return answer