initial commit on day 9

This commit is contained in:
Juan José Gutiérrez de Quevedo Pérez 2020-12-09 09:26:04 +01:00
commit f896e7c753
31 changed files with 8328 additions and 0 deletions

13
6/1.py Normal file
View file

@ -0,0 +1,13 @@
entry = set()
total = 0
with open("input") as f:
for line in f:
line = line.strip()
if not line:
total += len(entry)
entry = set()
else:
entry = set(line) | set(entry)
total += len(entry)
print(total)

19
6/2.py Normal file
View file

@ -0,0 +1,19 @@
entry = set()
total = 0
new_group = True
with open("input") as f:
for line in f:
line = line.strip()
if not line:
total += len(entry)
entry = set()
new_group = True
else:
if new_group:
new_group = False
entry = set(line)
else:
entry = set(line) & entry
total += len(entry)
print(total)

15
6/einput Normal file
View file

@ -0,0 +1,15 @@
abc
a
b
c
ab
ac
a
a
a
a
b

2172
6/input Normal file

File diff suppressed because it is too large Load diff