diff --git "a/leetcode3/\352\271\200\353\257\274\354\240\234/914. X of a Kind in a Deck of Cards.py" "b/leetcode3/\352\271\200\353\257\274\354\240\234/914. X of a Kind in a Deck of Cards.py" new file mode 100644 index 00000000..825f7f7f --- /dev/null +++ "b/leetcode3/\352\271\200\353\257\274\354\240\234/914. X of a Kind in a Deck of Cards.py" @@ -0,0 +1,12 @@ +from collections import Counter +from math import gcd + +def solution(deck): + counts = Counter(deck).values() + x = 0 + for count in counts: + x = gcd(x,count) + return x>1 + +arr = [1,2,3,4,4,3,2,1] +print(solution(arr))