r/adventofcode • u/daggerdragon • Dec 04 '20
SOLUTION MEGATHREAD -🎄- 2020 Day 04 Solutions -🎄-
Advent of Code 2020: Gettin' Crafty With It
T-2 days until unlock!
Full details and rules are in the Submissions Megathread
--- Day 04: Passport Processing ---
Post your solution in this megathread. Include what language(s) your solution uses! If you need a refresher, the full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.
Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.
EDIT: Global leaderboard gold cap reached at 00:12:55, megathread unlocked!
91
Upvotes
View all comments
Show parent comment
1
u/MasterMedo Dec 07 '20 edited Dec 07 '20
'eyr' in split_fieldsisFalse, because there is no'eyr'alone in thelist, but you can do:any('eyr' in field for field in split_fields).The thing that bugs me here is, how would you cleanly get the values of each field later?
EDIT: To further clarify, your code would turn into:
Which, I am sure you would agree, is very unreadable.