Browse Source

Add day 6

master
mid-kid 4 years ago
parent
commit
f1cafce65f
  1. 18
      d06.py
  2. 2001
      d06_input.txt
  3. 2
      d06_output.txt

18
d06.py

@ -0,0 +1,18 @@
#!/usr/bin/env python3
from sys import argv
i = [x.strip().split("\n") for x in open(argv[1]).read().split("\n\n")]
ok = 0
ok2 = 0
for g in i:
ci = set(g[0])
cx = set(g[0])
for p in g[1:]:
ci |= set(p)
cx &= set(p)
ok += len(ci)
ok2 += len(cx)
print(ok)
print(ok2)

2001
d06_input.txt

File diff suppressed because it is too large

2
d06_output.txt

@ -0,0 +1,2 @@
6310
3193
Loading…
Cancel
Save