-πŸŽ„- 2021 Day 18 Solutions -πŸŽ„-

This page summarizes the projects mentioned and recommended in the original post on /r/adventofcode

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • AdventOfCode

    My solutions for all years of Advent of Code in Python 3 and Rust (by benediktwerner)

  • Interesting approach. I guess mine could be considered a bit nicer, doing it recursively and returning the number to add to the left or right.

  • aoc

  • Wow! It'is almost exaclty my solution! :) https://github.com/xoposhiy/aoc/blob/main/2021/18.py

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • aoc

    Advent of Code - mscha's Perl 6 solutions (by mscha)

  • I wasted a lot of time creating a solution with a proper object model for SFNumber, with recursive SFNParts and all, but I couldn't figure out how to do the explosion – finding the numbers β€œto the left/right” was too hard.

  • aoc2021

    Advent of Code 2021, this time in Go (by danvk)

  • Here's my previous solution, which didn't use any mutation: https://github.com/danvk/aoc2021/blob/92b5352806e0e854ebc36e6c9804dc13b5262349/day18/day18.go

  • AdventOfCode

    My Advent of Code solutions. I also upload videos of my solves: https://www.youtube.com/channel/UCuWLIm0l4sDpEe28t41WITA

  • 46/40. Python

  • advent-of-code

    Advent of Code (by morgoth1145)

  • Python 32/30

  • AdventOfCodeSolutions

    My Advent Of Code Solutions (by Kroppeb)

  • Code and transformed input

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • adventofcode

    Advent of Code solutions (by mcpower)

  • Python, didn't leaderboard. Cleaned up code for part 1 and part 2.

  • advent2021

  • My solution

  • AoC2021

    Advent of Code 2021 solutions (JS) (by kunalb)

  • advent-of-code

    My Advent of code files (by timrprobocom)

  • github solution

  • adventofcode

    My solutions for Advent of Code (by fireduck64)

  • advent-of-code

  • Perl

  • adventofcode

    :christmas_tree: Advent of Code (2015-2023) in C# (by encse)

  • Advent-of-code

    My solutions of adventofcode.com (by MichalMarsalek)

  • AoC-2021

  • Python - github

  • Haskell

  • advent-of-code

    Solutions, scripting, and templates for adventofcode.com (by Javran)

  • Advent-Of-Code-2021

    My solutions to the Advent Of Code 2021. Uploaded the day after each challenge. (by C2thehris)

  • JavaScript

  • advent-of-code

    Advent of Code solutions in JS (by leyanlo)

  • aoc2021

    advent of code, 2021 (by mattcl)

  • I also really enjoyed today's problem from a "way the code feels" perspective. I, too, went the Enum route, with nom for the parsing. My part 2 runtime is 5 ms (which is one of the worst so far this AOC), though I "cheated" with a parallel iterators. I think I have some unnecessary clones, so I guess I'll look to clean that up at some point.

  • AoC2021

    My Advent of Code 2021 solutions in Minilang (by rajamukherji)

  • Part 1 Part 2

  • aoc2021

    Advent of Code 2021 on my homemade 16-bit CPU SCAMP (by jes)

  • adventofcode

    Advent of Code solutions of 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 and 2023 in Scala (by sim642)

  • My Scala solution.

  • toybox

  • C# since I don't see one posted here yet: https://github.com/LEPT0N/toybox/commit/b51ff07fc137c3e23c6b456bd5cbbcf9f744f366

  • aoc2021

    Advent of Code 2021 (Elixir + Pygame) (by p88h)

  • Elixir 934/972 ; 5ms/100ms

  • adventofcode

    Advent of Code challenge solutions (by flwyd)

  • Raku 1918/1873 at 2:23 and 2:31, which is my best score since day 1, despite taking ~20 times as long :-)

  • Fast Parse

    Writing Fast Parsers Fast in Scala

  • Mostly a mess of pattern matching. I really need to make some generic tree utilities. Haven't been able to find a decent parser combinator that works in Scala 3 (I usually use fastparse which depends heavily on Scala 2 macros, and scala-parser-combinators works in Scala 3, but I've had a lot of trouble getting it to not be too greedy), so I used the state monad from cats to parse at the bottom of the file, which I think turned out fairly nice.

  • Scala Parser Combinators

    simple combinator-based parsing for Scala. formerly part of the Scala standard library, now a separate community-maintained module

  • Mostly a mess of pattern matching. I really need to make some generic tree utilities. Haven't been able to find a decent parser combinator that works in Scala 3 (I usually use fastparse which depends heavily on Scala 2 macros, and scala-parser-combinators works in Scala 3, but I've had a lot of trouble getting it to not be too greedy), so I used the state monad from cats to parse at the bottom of the file, which I think turned out fairly nice.

  • Advent-Of-Code

    My solutions to all Advent of Code questions (by Anshuman-UCSB)

  • advent-of-code-2021

  • aoc21

  • A pretty straightforward binary tree-based implementation: https://gitlab.com/dos1/aoc21/-/blob/main/day18.py

  • advent2021

    Advent of Code 2020 solutions in C++ (by bustercopley)

  • Original

  • AdventOfCode

    Hacky solutions for [Advent of Code](https://adventofcode.com), working on past problems (by AllanTaylor314)

  • Python 3

  • aoc

    My solutions to Advent of Code problems. Not good examples for anything. (by BrianDead)

  • Link to code

  • advent-of-code

    Advent of code solutions (by Fubuchi)

  • aoc

    Discontinued Advent of code (by payou42)

  • adventofcode

    πŸŽ… Repo where anyone can solve puzzles from adventofcode.com (by kolonialno)

  • aoc21

    Advent of code 2021.

  • AdventOfCode2021

  • aoc2021

    My aoc2021 solutions in Go (by graynk)

  • github

  • advent2021

  • AdventOfCode

    My solutions to the Advent of Code challenge (by Jessseee)

  • Python 3.8+

  • Go

  • aoc2021

    Advent of Code 2021 - my answers

  • Haskell Kotlin 622/1185

  • advent-of-code

    advent of code (by fridokus)

  • AdventOfCode2020

    Advent of Code (by LennardF1989)

  • Advent_of_Code_2021

    Advent of Code for 2021 (currently in Swift) (by Loqaritm)

  • Swift

  • aoc_2021_rust

    Advent of Code 2021

  • advent-of-code

  • advent_of_code_2021

    Solutions for Advent of Code 2021 (by ropewalker)

  • advent-of-code-2021

    zig solutions to advent of code 2021 (by jchevertonwynne)

  • aoc-rust

  • Rust

  • Advent-of-Code

    Advent of Code (by michaeljgallagher)

  • What a headache

  • aoc-2021

    Advent of Code 2021 (by mintopia)

  • Snailfish and Reducing/Exploding/Splitting

  • advent2021

    Advent of Code 2021 (by arjanIng)

  • aoc2021

  • AdventOfCode-2021

  • Code

  • adventofcode

    Python solutions to Advent of Code puzzles, https://adventofcode.com/ (by fuglede)

  • Python 3. 3 takes today: 1 using nasty string replacements, 1 using a "class Node" style implementation of a binary tree, and finally just deciding to go with a dictionary mapping leaf node positions to their values; point being that in-order traversal comes for free, and the operations to be implemented all end up reasonably simple.

  • advent-of-code-2021

    Python solutions to Advent of Code 2021 (by nitekat1124)

  • Python solution using regex, nothing fancy but it works

  • advent-of-code-solutions

    My JS solutions for https://adventofcode.com/ (by AugustsK)

  • At first, I thought I will be really clever by just keeping numbers as is. Well - nothing of what I did today was clever. So this is my first attempt at part 1-> GitHub link.

  • aoc-2021

    Learning Rust by solving Advent of Code (code review is welcome) (by mvolfik)

  • adventofcode

    Advent of code solutions (by mathsaey)

  • advent-of-code-2021

  • advent-of-code-2021

    My solutions to the Advent of Code 2021 puzzles. (by shnako)

  • List-based solution - runs part 2 in 2s.

  • aoc2021

  • AdventOfCode2021

  • Python + Regex Magic: https://github.com/TynanWilke/AdventOfCode2021/blob/main/18/explode1.py https://github.com/TynanWilke/AdventOfCode2021/blob/main/18/explode2.py

  • Advent_of_Code_in_Pascal

    My solutions to the Advent of Code, in Free Pascal

  • Pascal - Github

  • AoC_2021

    advent of code 2021 (by jwezorek)

  • github

  • AdventOfCode2021

    Advent of code 2021 (by marcodelmastro)

  • aoc2021

    Advent of Code 2021 (by eoincampbell)

  • adventofcode_2021

    AdventOfCode 2021 (by aelzeiny)

  • Python 3 Readable Binary Search Tree Implementation

  • adventofcode2021

    Advent of Code 2021 in Elixir (by hermanstehouwer)

  • AdventOfCode2021

  • Full program on GitHub.

  • adventofcode

    Advent Of Code 2018 - 2021 (by nsmaciej)

  • I did something super similar, except initially I only kept track of opening brackets. It actually worked really well but the code is much simpler if I also track the closing brackets. Takes around 7.5ms for both parts on my machine. https://github.com/mgoszcz2/adventofcode/blob/master/2021/src/day18.rs

  • adventofcode

    Solutions for problems from AdventOfCode.com (by bhosale-ajay)

  • TypeScript, Worked with a flat structure which tracks [value, depth], taking about 200ms to solve part 1 and part 2 for test and actual input.

  • AoC-2021

    Solutions to Advent of Code (https://adventofcode.com/2021) (by InfinityByTen)

  • Rust

  • aoc2021

    Solutions for the Advent of Code 2021 (by jkaye2012)

  • AdventOfCode2021FSharp

    Solutions for Advent of Code 2021 in F#

  • F# solution in Jupyter Notebook. Thank God for the Haskell programmers! I would not have been able to solve this without peeking at their some of their code. Parsing the input string was just the first of the challenges! I envy those dynamic programming languages with an eval function.

  • Advent-of-Code-2021

    Made it through all 25 days of Advent of Code for the second time! (by Leftfish)

  • As a complete hobbyist, I was glad I figured out this had something to do with binary trees. It took about an hour to design everything on paper. Then I started to code it...and then debug...and four hours later I finally arrived at this solution.

  • sbailie-aoc-2021

  • Python (using regex)

  • aoc

    Advent of Code Solutions (by joeyemerson)

  • AdventOfCodeCSharp

    My AoC Solutions

  • C# 3406/9233 :oof:

  • advent-of-code-2021

    Advent of Code 2021 solutions and test runner (by delventhalz)

  • nom

    Rust parser combinator framework

  • Wrt. parsing, my AOC-experience is that rust works really well with recursive descent parsers probably because of the combination of native slices and enum returns. You can use parser combinators like nom, but with Context for error handling it is often just as concise to do without. This is what I had for parser today:

  • adventofcode

    Advent of code in rust (by Japanuspus)

  • My rust solution

  • AdventOfCode2021

    My solutions for the 2021 Advent of Code problems. (by Goldenlion5648)

  • Python

  • advent

    advent of code (by jasontconnell)

  • AOC2021-in-Fortran

    Advent of Code 2021 solutions in Fortran

  • Part 1

  • advent-of-code-2021

  • aoc2021

    Advent of code 2021 (by pbruyninckx)

  • github

  • advent-of-code

    My Advent of Code answers (by tcsullivan)

  • Clojure. GitHub.

  • adventofcode2021

    My Solution to AOC2021 (by HrRodan)

  • AdventOfCode2021

    My solutions to https://adventofcode.com/2021 (by willkill07)

  • AdventofCode

  • Github

  • advent-2021

    Discontinued [Moved to: https://github.com/Crazytieguy/advent-of-code] (by Crazytieguy)

  • deno_aoc

    πŸŽ„ Advent of code solutions written in TypeScript for Deno.

  • advent-of-code-2021

    Misha's Advent of Code 2021 "hacking" (by mramendi)

  • adventofcode

    Solutions for Advent of Code (by tipa16384)

  • AoC2021

  • Python using a graph of nodes.

  • advent2021

  • Python

  • advent-of-code-2021

    My solutions to Advent of Code 2021 problems (by juanplopes)

  • adventofcode

    Answers to Advent of Code (by viceroypenguin)

  • AdventOfCode

  • Python

  • advent-of-code-2021

    Advent of Code 2021 solutions (by paolostyle)

  • Rust

  • advent-of-code-2021

  • AdventOfCode

  • advent-of-code

  • Common Lisp Truly ugly day, took me about 4 hours for part 1 and submitted more than 24h past the puzzle for the first :(

  • advent_of_code_2021_v2

  • advent-of-code

    Advent of Code Solutions (by karjonas)

  • Rust GitHub. This took me much longer that I care to admit. I started with a tree-based solution, tried a list, went back to tree and the back to the list again...

  • adventofcode

    https://adventofcode.com/2021/ (by Torakushi)

  • AOC2021

    My solutions to AOC 2021 (by EfficientBogoSort)

  • Python 3

  • aoc

    my solutions to Advent of Code puzzles (by MarcoLucidi01)

  • adventofcode

    Solutions to Advent of Code in Go (by 1e9y)

  • advent-of-code

    My Advent of Code solutions (by premun)

  • AOCSnailMath

    Advent of code snail math solution Gambas3

  • advent-of-code-2021

    All solutions for the 2021 Advent of Code event. (by Bruception)

  • Advent-of-Code

    My solutions for the Advent of Code puzzles (work in progress). (by tbpaolini)

  • Bonus: Helper function to build the binary tree

  • Advent-of-Code-2021

  • GitHub

  • AdventOfCode_2021

    My Solutions to the Advent of Code 2021 (by HansBambel)

  • I managed after a very long time to solve it with a class structure. Not the nicest code, but it was a lot of fun. Also visualizing and scribbling multiple trees was definitely needed and also a lot of fun. Here's my code

  • aoc-2021

  • Great solution. I was tired and stuck today so I decided to skimp and well, let's say let your solution inspire me. I did make one change though - using the experimental box pattern feature, it is possible to get around some of the matching gore in `explode`. In case you are interested, here's the commit with only those changes: https://github.com/barafael/aoc-2021/commit/049ae76a3493cfa7d7813d3e057c0e06c09cc90f

  • AdventOfCode2021.jl

    Advent of Code 2021 in Julia

  • advent-of-code

  • I spent a long time on this on Sunday but really enjoyed it. I've linked the code for the day above but I've split off the library functions into my general AoC repository, they're in zipper.lisp maybe.lisp and a couple of functions in monad.lisp.

  • adventofcode

    My collection of Advent of Code solutions in a slightly overkill project setup πŸ™ƒπŸ‘» (by marcelblijleven)

  • My solution for today: https://github.com/marcelblijleven/adventofcode/blob/master/src/adventofcode/year_2021/day_18_2021.py

  • advent-of-code-go

    All 8 years of adventofcode.com solutions in Go/Golang; 2015 2016 2017 2018 2019 2020 2021 2022

  • adventofcode-2021

  • AdventOfCode2021

  • advent-of-code

    Collection of JS solutions for puzzles from adventofcode.com πŸŽπŸŽ„ (by romellem)

  • Otherwise, the main way I solved this was with a flat list of tokens rather than a truly nested structure. This was very similar to last year's Day 18, which I also solved in a similar manner.

  • advent-of-code-2021

    My Advent of Code solutions. I prioritize readability over performance where possible. (by tcc-sejohnson)

  • advent-of-code-2021

    Advent of Code 2021 Solutions (by jerchende)

  • Parsed the input into an object tree. Wrote a lot of tests.

  • advent-of-code

    My solutions for Advent of Code (by Apreche)

  • aoc-clojure

    Advent of code 2020 solutions in Clojure

  • aoc2021

    Advent of Code 2021 Solutions (by nlowe)

  • Go, 19196/19041

  • aoc-2021-in-kotlin

  • advent_of_code_2021

    Golang solutions to advent of code 2021 (by Stefansfrank)

  • I am pretty satisfied with my solution to this problem even though there is some optimization potential left on the table - it solves the puzzle in 500 ms on my MB pro.

  • advent-of-code

    Advent of code solutions (by tallbikeguy)

  • Advent_Of_Code

    My own solutions for http://adventofcode.com (by VSZM)

  • Solution

  • advent2021

    Advent of Code 2021: This Time It's Go Time (by Resisty)

  • Golang: https://github.com/Resisty/advent2021/blob/main/cmd/day18/day18.go

  • advent-of-code-kotlin-2021

    Advent of Code 2021 Challenge (by PhenixFine)

  • Kotlin - I went with solving it in place ( sort of, I had to replace [ ] with ( ) because of the way I stored the numbers ). My first day attempt of it I tried to do it with binary tree, but I'm just not familiar enough with the subject to do it that way and I failed miserably ( I'm studying the subject now, as I think it will be helpful with future code challenges ). So my next day attempt I figured I'd try solving it in place and everything worked out really well ( solved it yesterday, but wanted today to review my code before submitting it ).

  • advent-of-code

    Synergy Codes' developers and their attempts to solve "Advent of Code" riddles (by synergycodes)

  • Full code

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts