From 74a6f4391f209aeee84bf3cf393879f573943a30 Mon Sep 17 00:00:00 2001 From: masterMJ Date: Wed, 12 Aug 2026 13:00:20 +0900 Subject: [PATCH] Create 914. X of a Kind in a Deck of Cards.py --- .../914. X of a Kind in a Deck of Cards.py" | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 "leetcode3/\352\271\200\353\257\274\354\240\234/914. X of a Kind in a Deck of Cards.py" 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))