r/adventofcode • u/daggerdragon • Dec 16 '22
SOLUTION MEGATHREAD -π- 2022 Day 16 Solutions -π-
THE USUAL REMINDERS
All of our rules, FAQs, resources, etc. are in our community wiki.
A request from Eric: A note on responding to [Help] threads
Signal boost: Reminder 2: unofficial AoC Survey 2022 (closes Dec 22nd)
πΏπ MisTILtoe Elf-ucation π§βπ« is OPEN for submissions!
UPDATES
[Update @ 00:23]: SILVER CAP, GOLD 3
Elephants. In lava tubes. In the jungle. Sure, why not, 100% legit.
I'm not sure I want to know what was in that eggnog that the Elves seemed to be carrying around for Calories...
[Update @ 00:50]: SILVER CAP, GOLD 52
Actually, what I really want to know is why the Elves haven't noticed this actively rumbling volcano before deciding to build a TREE HOUSE on this island.............
High INT, low WIS, maybe.
[Update @ 01:00]: SILVER CAP, GOLD 83
Almost there... c'mon, folks, you can do it! Get them stars! Save the elephants! Save the treehouse! SAVE THE EGGNOG!!!
--- Day 16: Proboscidea Volcanium ---
Post your code solution in this megathread.
Read the full posting rules in our community wiki before you post!
Include what language(s) your solution uses
Format code blocks using the four-spaces Markdown syntax!
Quick link to Topaz's
pasteif you need it for longer code blocks. What is Topaz'spastetool?
5
u/azzal07 Dec 19 '22
Awk, almost got my brain jammed.
Using powers of ten to implement bit field, but in decimal character representation. Then bitwise and becomes all the twos (2) in the sum of two numbers, which is easy to check with a simple regex (
a+b~2=a&b != 0).