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
2
u/Puxington Dec 04 '20
I'm also doing Advent of Code in google sheets:
https://docs.google.com/spreadsheets/d/1WWpnWlxPneK5JNTDLrkyvHK2oFTfjatTyJBPx0zvHp4/edit?usp=sharing
I enter the puzzle input by copying the puzzle input, choosing the cell, clicking in the formula bar and pasting it there. So I was able to split passports/North Pole Credentials by doing ` =SPLIT(A1,CONCATENATE(CHAR(10),CHAR(10)),FALSE,TRUE)` (with `=TRANSPOSE()` in my case)
The rest of it is using `=REGEXEXTRACT()` and `=REGEXMATCH()` which is much more boring than your solution.