Skip to content

Commit f673aa5

Browse files
Merge pull request #1821 from CodingTestStudy2/최원준
[최원준] Day14
2 parents a991a45 + b1463d3 commit f673aa5

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from collections import defaultdict
2+
class Solution:
3+
def hasGroupsSizeX(self, deck: List[int]) -> bool:
4+
counter = defaultdict(int)
5+
for d in deck:
6+
counter[d] += 1
7+
8+
count = counter[deck[0]]
9+
for _, freq in counter.items():
10+
if freq == 1:
11+
return False
12+
count = gcd(count, freq)
13+
14+
return True if count != 1 else False
15+

0 commit comments

Comments
 (0)