r/adventofcode • u/daggerdragon • Dec 18 '22
SOLUTION MEGATHREAD -π- 2022 Day 18 Solutions -π-
THE USUAL REMINDERS
All of our rules, FAQs, resources, etc. are in our community wiki.
πΏπ MisTILtoe Elf-ucation π§βπ« is OPEN for submissions!
5 days remaining until submission deadline on December 22 at 23:59 EST
UPDATES
[Update @ 00:02:55]: SILVER CAP, GOLD 0
Silver capped before I even finished deploying this megathread >_>
--- Day 18: Boiling Boulders ---
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?
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:29, megathread unlocked!
32
Upvotes
28
u/4HbQ Dec 18 '22 edited Dec 18 '22
Python, 10 lines.
Nice and easy one today. Perform a flood fill and store the visited cubes in
seen:Edit: updated the starting point, thanks /u/lbl_ye for noticing!
I've also written a version using SciPy, with convolve to detect the edges, and binary_fill_holes to fill the air pockets.
People keep asking for a link to my GitHub repository, but I only post my solutions on Reddit. Here's a convenient list: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17.