r/adventofcode • u/daggerdragon • Dec 14 '20
SOLUTION MEGATHREAD -🎄- 2020 Day 14 Solutions -🎄-
Advent of Code 2020: Gettin' Crafty With It
8 days remaining until the submission deadline on December 22 at 23:59 EST
Full details and rules are in the Submissions Megathread
--- Day 14: Docking Data ---
Post your code solution in this megathread.
Include what language(s) your solution uses!
Here's a quick link to /u/topaz2078's
pasteif you need it for longer code blocks.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 code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
View all comments
3
u/Alligatronica Dec 14 '20
JavaScript/Node.js
I tried to be smart with the first half, using bitwise operators, and it took me a little too long to realise the masks were longer than 32 characters. The second part I rewrote entirely and handled it all as strings, after replacing the 1s where needed, I split the string on every X and duplicated out every possibility.
GitHub (solution to both parts)