We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e5d78a commit e750210Copy full SHA for e750210
1 file changed
yongjun-0903/시소 짝꿍.py
@@ -0,0 +1,17 @@
1
+from itertools import combinations
2
+from math import gcd
3
+
4
+def solution(weights):
5
+ answer = 0
6
+ combs = list(combinations(weights, 2))
7
+ siso = [2, 3, 4]
8
9
+ for comb in combs:
10
+ if comb[0] == comb[1]:
11
+ answer += 1
12
+ else:
13
+ x = gcd(comb[0], comb[1])
14
+ if comb[0] // x and comb[1] // x in siso:
15
16
17
+ return answer
0 commit comments