Conformity
This commit is contained in:
21
conformity.py
Normal file
21
conformity.py
Normal file
@@ -0,0 +1,21 @@
|
||||
n = int(input())
|
||||
|
||||
combinations = {}
|
||||
maxcombi = 0
|
||||
combinations[maxcombi] = 0
|
||||
|
||||
for _ in range(n):
|
||||
combi = "".join(sorted(input().strip().split()))
|
||||
if combi in combinations.keys():
|
||||
combinations[combi] += 1
|
||||
if combinations[maxcombi] < combinations[combi]:
|
||||
maxcombi = combi
|
||||
else:
|
||||
combinations[combi] = 1
|
||||
|
||||
max_value = combinations[maxcombi]
|
||||
most_popular = sum(
|
||||
[max_value for key in combinations if combinations[key] == max_value]
|
||||
)
|
||||
|
||||
print(most_popular if most_popular > 0 else len(combinations.keys()) - 1)
|
||||
Reference in New Issue
Block a user