advent-of-code-2020/6/a.py

21 lines
322 B
Python
Raw Normal View History

2020-12-07 17:43:43 +08:00
lines = open('input').read().splitlines()
arr = []
_ = []
for line in lines:
if line == '':
arr.append(_)
_ = []
else:
_.append(list(line))
arr.append(_)
c = 0
for group in arr:
s = []
for p in group:
s = s+p
# print(group)
# print(s)
c += len(set(s))
print(c)