adventofcode-2020/06/part2

17 lines
371 B
Plaintext
Raw Permalink Normal View History

2020-12-13 16:20:12 +01:00
#!/usr/bin/python3
import string
sum = 0
with open("input") as fh:
groups = fh.read().split("\n\n")
for g in groups:
g = g.strip()
g_yes = set(string.ascii_lowercase)
for p in g.split("\n"):
p_yes = set(p)
g_yes = g_yes & p_yes
sum += len(g_yes)
print(g.replace("\n", "."), g_yes, sum)
print(sum)