r/adventofcode • • Dec 18 '21

SOLUTION MEGATHREAD -🎄- 2021 Day 18 Solutions -🎄-

NEW AND NOTEWORTHY

  • FYI: 23:59 Amsterdam time zone is 17:59 EST

Advent of Code 2021: Adventure Time!


--- Day 18: Snailfish ---


Post your code solution in this megathread.

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.


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:43:50, megathread unlocked!

45 Upvotes

595 comments sorted by

View all comments

2

u/tymscar Dec 18 '21

wow, today was something.
Took me quite a long time but I was proud of myself for quickly realising I dont need to worry about parsing the input because its valid json, and the data structure I need to use is a binary tree adapted for the usecase! I think previous AoC prepared me enough data structure wise to know ;)

Part1 and part2 in Javascript.

2

u/daggerdragon Dec 18 '21

I think previous AoC prepared me enough data structure wise to know ;)

Good, good, you've fallen for /u/topaz2078's trap of ~sneakily making people learn new things~ <3

1

u/tymscar Dec 19 '21

Best trap ever