There was an error while loading. Please reload this page.
2 parents fed4acb + 74a6f43 commit b41b9d0Copy full SHA for b41b9d0
1 file changed
leetcode3/김민제/914. X of a Kind in a Deck of Cards.py
@@ -0,0 +1,12 @@
1
+from collections import Counter
2
+from math import gcd
3
+
4
+def solution(deck):
5
+ counts = Counter(deck).values()
6
+ x = 0
7
+ for count in counts:
8
+ x = gcd(x,count)
9
+ return x>1
10
11
+arr = [1,2,3,4,4,3,2,1]
12
+print(solution(arr))
0 commit comments