aoc/06/06_minimal.py

8 lines
249 B
Python

with open("input.txt","r") as f:
groups = f.read().split('\n\n')
print(
(
sum(map(len, [set(list(group.replace('\n',''))) for group in groups])),
sum(map(len,[set.intersection(*map(set, map(list,group.split('\n')))) for group in groups]))
)
)