Finish day 4 part 1

This commit is contained in:
Ethanell 2020-12-04 11:22:47 +01:00
parent 795b015ac9
commit d156f31e94
2 changed files with 1036 additions and 0 deletions

1023
2020/day 4/P1/input.txt Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
print(
len(
list(
filter(
lambda x: all(y in [e[1] for e in x] for y in ["byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"]),
map(
lambda x: __import__("re").findall(r"((byr|iyr|eyr|hgt|hcl|ecl|pid|cid):([a-zA-Z0-9#]+))", x),
[m.replace("\n", " ") for m in open("input.txt").read().split("\n\n")]
)
)
)
)
)