adventofcode-2020/06/solve02.py
2021-12-14 22:20:48 +01:00

17 lines
346 B
Python

#!/usr/bin/env python
import string
ans_yes = 0
with open("input01.txt","r") as f:
answers = set(string.ascii_lowercase)
for line in f:
line = line.strip()
if len(line) == 0:
ans_yes += len(answers)
answers = set(string.ascii_lowercase)
continue
answers = answers.intersection(set(line))
ans_yes += len(answers)
print(ans_yes)