-🎄- 2021 Day 16 Solutions -🎄-

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

Our great sponsors
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • Scout APM - Less time debugging, more time building
  • SaaSHub - Software Alternatives and Reviews
  • advent-of-code

    My Advent of Code solutions (by premun)

    My solution was to pretend it's a Stream and treat is one using a small abstraction: https://github.com/premun/advent-of-code/blob/main/src/16/BitReader.cs

  • aoc2021

    Advent of Code 2021 - my answers

    Looks somewhat similar in approach to mine, but instead of keeping track of the number of bits consumed myself, I simply re-use the position that it already keeps track of, plus a tiny bit of user-specified state so that I can parse directly from the hexadecimal representation, no need to build an intermediate String for the binary representation.

  • SonarLint

    Deliver Cleaner and Safer Code - Right in Your IDE of Choice!. SonarLint is a free and open source IDE extension that identifies and catches bugs and vulnerabilities as you code, directly in the IDE. Install from your favorite IDE marketplace today.

  • nom

    Rust parser combinator framework

    Parsing is made by implementing an Iterator giving next bits on every iteration. It may be interesting to write nom parser for this format - I've chosen to write everything by hand. I think it turned out pretty well, my solution runs in 6ms for both parts.

  • advent-of-code-2021

    Advent of Code 2021 https://adventofcode.com/2021 (by bozdoz)

    Here's my Day 16 if you're interested: https://github.com/bozdoz/advent-of-code-2021/tree/main/16

  • advent-of-code

    Advent of Code (by morgoth1145)

    Python 3 143/89

  • Advent-Of-Code

    Combination of all advent of code years done starting 2021 (by Anshuman-UCSB)

  • adventofcode

    My solutions for Advent of Code (by fireduck64)

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • advent-of-code

    My Advent of code files (by timrprobocom)

  • adventofcode

    Solution

  • advent-of-code

    TypeScript solutions for Advent of Code (by ElCholoGamer)

    TypeScript: https://github.com/ElCholoGamer/advent-of-code/blob/main/src/days/2021/16.ts

  • adventofcode

    Advent Of Code 2018 - 2021 (by maciej-irl)

  • advent

    Git mirror of https://bitbucket.org/sjl/advent (by sjl)

  • AdventOfCode-Java

    adventOfCode(Language.JAVA);

  • Advent-of-Code-2021

    Advent of Code Solutions 2021 in Python (by DenverCoder1)

  • AdventOfCodeCSharp

    My AoC Solutions

    C# 2283/1968

  • aoc2021

    Advent of Code 2021 Solutions (by nlowe)

    Go, 2758/2421

  • advent-of-code-2021

    Advent of Code 2021, solved using Rust (by klimesf)

    Rust

  • adventofcode

    Advent of Code challenge solutions (by flwyd)

    Raku, 2388 / 2366, which suggests that everyone else who worked at my pace also quickly realized that part 2 would be "Evaluate the stack of values."

  • aoc_2021

    C# (2247,3170) Recognize from part 1 that this is gonna be a pseudo programming language. Spent most of part 1 implementing lexer and parser. For part 2, i implement a Visitor pattern for fun but got bogged down with "number too low" in debugging while the logic is already correct.

  • advent-of-code

    Perl Original solution was full of substr(), in last commit it's much more tidy... I left few die() asserts here and there in case I wanted to mess with the code again ;)

  • aoc

    Advent of Code (by quickthom)

    Python 3 (3546/3543), object-oriented solution

  • deno_aoc

    🎄 Advent of code solutions written in TypeScript for Deno.

  • AdventOfCode2020

  • advent

    🎄 My 2019, 2020, and 2021 Advent of Code solutions

    Rust iterator approach

  • source

  • advent-of-code

    My solutions to advent of code problems (by dopplershift)

    Python 3 1903/1496 (GitHub)

  • toybox

    C# https://github.com/LEPT0N/toybox/commit/f18b2e492a697d65bfb274e441fbb2dde439abc6 Probably took me longer to parse the instructions! Got to use BitArray, which is fun since I've never had a reason to do that before.

  • advent-of-code

    Common Lisp. Christ this was a sad day. I probably had part 1 in 40 minutes (or I would have if emacs didn't start hanging which necessitated a huge apt-get update/apt-get upgrade 40 minutes in), but then I got hung up until ~3hrs by the "padding" stuff and trying to parse more than one root-level packet from the string. Uggghhh.

  • advent-of-code

    My solutions for the Advent of Code (by JesperDramsch)

    Today was rough. Code is too long to post here. Github Basically using indexes and a bit of recursion for this.

  • advent-of-code-2021

    Advent of Code 2021 Java 17 (by zebalu)

    Java, the code is still a mess, but if you need some tips, it might help.

  • aoc2021

    Python

  • aoc-2021

    PHP

  • aoc2021

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

  • advent-of-code

    advent of code (by fridokus)

    On github

  • aoc2021

  • advent-of-code

    AoC! (by pevdh)

  • AdventOfCode2021-python

    My algorithms for AdventOfCode2021 in python

    Using Python3

  • adventofcode

    Advent of code solutions (by mathsaey)

  • advent-of-code

    Advent of Code solutions in JS (by leyanlo)

  • Advent_of_Code_in_Pascal

    My solutions to the Advent of Code, in Free Pascal

    Pascal 7079/6330 - github

  • aoc-2021

    Advent of Code 2021 (by mintopia)

    Parsing

  • advent-of-code-2021

    zig solutions to advent of code 2021 (by jchevertonwynne)

  • adventofcode

  • advent-of-code

    My Advent of Code solutions through the years - mostly JS (by davidsharp)

    I enjoyed this one, despite all the reading. Felt like a nice change of gear from yesterday's. Using recursion to read sub-packets from the binary string, using a function that returns the value (or version sum in part 1) as well as the length, so I know where to read from for the next sub-packet.

  • adventofcode

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

  • AdventOfCode

    GitHub

  • advent-of-code

  • advent-of-code-haskell

  • advent2021

  • AdventOfCode2021

    Advent of code 2021 (by marcodelmastro)

  • aoc2021

    Advent of Code 2021 (by sotolf2)

  • Advent-of-Code

    bad christmas spaghett (by YelovSK)

    GitHub link - I didn't know how to call my parse_packet function if I got a specific length vs a number of packets in the operator, so if I get a specific length I call the function recursively and if I get a number of packets I call it N times without recursion.

  • aoc2021

    Advent of Code 2021, in Rust (by Killavus)

  • aoc2021

    My solutions to Advent of Code 2021 puzzles in Python 3. (by st-vincent1)

  • advent-of-code-2021

    Code I used for solving https://adventofcode.com/2021 (by pavel1269)

  • adventofcode

    Advent of code (by Peter554)

  • aoc

    Rust

  • Advent-of-Code

    My solutions for the Advent of Code challenages (by Stannislav)

    Python 3.10: source

  • AdventOfCode2021

    Loved today's puzzle after I didn't really enjoy yesterday's at all. Solved it in Python and finally installed Python 3.10 for it - gotta say that Python is slowly becoming okay for language implementation stuff :D https://github.com/SV-97/AdventOfCode2021/blob/main/Day_16_2/main.py

  • adventofcode2021

    Advent Of Code 2021 Solutions (by agardes)

    AoC is definitly getting harder. After giving up on yesterday's (for now) I'm kinda glad I managed today's. Javascript solution

  • advent-of-code-2021

    AOC in go (by alextanhongpin)

  • aoc2021

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

  • advent-of-code-2021

  • adventofcode2021

    Classic recursive descent https://github.com/schoelle/adventofcode2021/blob/main/16-go/decode.go

  • Advent-of-code

    Advent of code (by blueedgetechno)

  • adventofcode

    ES6 solutions to Advent of Code puzzles. (by surgi1)

    both parts

  • advent-of-code-2021

    Rust

  • AdventOfCodeHaskell

    Advent of Code in Haskell

    Haskell. Reading the input in a monadic way with State, the rest is quite straightforward.

  • advent-of-code-solutions

    My solutions to puzzles at https://adventofcode.com/ (by erikw)

    part1.rb

  • Advent_of_Code2021

    Solutions to Advent of COde 2021 (by cettt)

    Well save to say, this was my least favorite puzzle since 2018: and I still had a lot of fun :) I used two global variables: one keeping track of the current index and adding up the version numbers. I am praying that there won't be a follow up on this :D github

  • coding_challenges

    Various Coding challenges with my solutions (by BigPeet)

    main.rs and lib.rs.

  • advent-of-code-2021

    Advent of Code 2021 in 25 programming languages (by urholaukkarinen)

    main.cr

  • AdventOfCode2021

    Some solutions for as much of advent of code 2021 as I can be bothered to do. (by TomHemery)

    C# Github

  • advent-of-code-2021

    In Common Lisp (by brunal)

  • AdventOfCode

    C# solutions for Advent of Code (by AlFasGD)

    Link

  • advent_of_code_2021

    Advent of Code 2021 in Rust (by tslater2006)

    Here is my Rust solution.

  • AoC

    Advento of Code - Day 11 simple simulation (by vendash)

    Github

  • advent

    My Advent of Code solutions (by jakeledoux)

    Rust (GitHub)

  • advent-of-code-2021

    Python solutions for Advent of Code 2021 (by nitekat1124)

    Python Github

  • Advent-of-Code

    Advent of Code (by michaeljgallagher)

    Ugh, what a mess.

  • advent-of-code-2021

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

  • AdventOfCode

    My Advent of Code solutions throughout the years. Mainly C#. (by InKahootz)

  • Advent2021

  • hello-world

    Innocent first test. (by SheepTester)

    JavaScript 21/19 [Code] [Video]

  • J solution https://github.com/Toanuvo/Advent-of-code-2021/blob/main/J/day16.ijs

  • AdventOfCode2021

  • specter

    Clojure(Script)'s missing piece

    For part 1, the version (and other things) are attached to the metadata of each sexp, and a Specter recursive path is used to extract all of the versions.

  • advent_of_code

    Advent of Code solutions (by cjhubbs)

  • code-challenges

    My solutions to various code challenges

    Ruby

  • AoC2021

    Advent of Code 2021 (by gereons)

  • advent-2021-kotlin

    :christmas_tree: Advent of Code 2021: Solutions in Kotlin

    Once I finally understood how the examples worked with subpackets, I was able to come up with what I think is a nice clean solution. I ended up using an Iterator that got passed around to various sealed types that would parse themselves out. I defined several extension functions on Iterator to make things easier to read.

  • advent_of_code

    Advent of Code solutions (by domm)

  • advent-of-code-2021

    Solutions for the Advent of Code 2021 puzzles (by lucashmsilva)

  • AdventOfCode2021

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

  • aoc

    Advent of Code Solutions (by joeyemerson)

  • advent-of-code-solutions

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

  • AOC2021-in-Fortran

    Advent of Code 2021 solutions in Fortran

  • AdventOfCode2021

    C#

  • aoc2021

    Advent of Code 2021 (by ntsoftware)

    Here is my Python day 16 solution

  • aoc

    Advent of Code solutions (by vodik)

    Rust

  • advent-2021

  • advent-of-code-2021

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

  • advent-of-code-2021

    Clojure

  • advent2021

    Advent of Code 2021 in Rust (by cdparks)

    [Rust](https://github.com/cdparks/advent2021/blob/cdd3d94e8da7be5cbc04b5d2bf73e23c6a0b9a1b/advent/src/day16.rs)

  • adventofcode2021

    My Solution to AOC2021 (by HrRodan)

    I used an iterator for going through the binary number. I wrote the results in a 1d array which gets cleaned up and finally converted to a string and executed with eval(). https://github.com/HrRodan/adventofcode2021/blob/master/day16/day16.py

  • aoc

    Advent of Code solutions (by fuzesmarcell)

  • advent-of-code-2021

    My solutions to advent of code 2021 in deno/TS (by J-Swift)

  • aoc_2021_rust

    Advent of Code 2021

  • adventofcode

    Advent of code solutions (by SuddenGunter)

    first AoC this year that forced me to write a lot of unit tests, so I at least build the solution in a block-by-block basis, instead of writing the whole thing as a single piece of code https://github.com/SuddenGunter/adventofcode/tree/main/2021/day16

  • adventofcode

    Advent of Code Solutions (by LiquidFun)

    Kind-of code golfed and hacky solution. Prints both part 1 and 2. Repo.

  • adventofcode2021

    🎄 Advent of Code 2021 in R 🎄 (by bodkan)

    R solution

  • aoc-2021

    PHP solutions to https://adventofcode.com/ for 2021 (by Belzebell)

    PHP Recursive Function

  • aoc2021

    Solutions to advent-of-code (https://adventofcode.com/) for 2021 (by fizbin)

  • aoc2021

  • Javascript

  • advent-of-code

    Advent of code solutions (by rbusquet)

  • advent-of-code-2021

    Github

  • AOC2021

  • AdventOfCode

    Advent of Code Solutions (by auxym)

  • advent_of_code

  • AdventOfCode2021FSharp

    Solutions for Advent of Code 2021 in F#

    F# with Jupyter Notebook. Learned how to use recursive types today! Half-way through the problem I was starting to wonder whether BITS was going to be the new IntCode.

  • AdventOfCode2021.jl

    Advent of Code 2021 in Julia

  • advent-of-code-2021

    Advent of Code 2021 (by cylab)

  • Common Lisp

  • adventofcode

    My collection of Advent of Code solutions in a slightly overkill project setup 🙃👻 (by marcelblijleven)

  • advent_of_code_2021

    Solutions for Advent of Code 2021 (by ropewalker)

    Okay, I am posting it here for the sake of completion, but I don't think it is any good, and I didn't like the problem much. Rust: https://github.com/ropewalker/advent_of_code_2021/blob/master/src/day16.rs

  • advent-of-code-2021

    🎄 My Advent of Code solutions in Rust. http://adventofcode.com/2021

    Part 2 0.022ms (22μs)

  • PyJpegDecoder

    A JPEG decoder made in Python, that supports both baseline (sequential) and progressive images.

    Not too long ago I made a JPEG Decoder in Python, which used a similar logic than the current puzzle, but on steroids. This gave the the skill set to tackle the puzzle in a relatively efficient manner.

  • AdventofCode

  • aoc-typescript

  • AdventOfCode2021

    My solutions to the Advent of Code 2021 puzzles. (by kemmel-dev)

  • adventofcode

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

    F# Late to the party, easy puzzle today helped me to finish F# implementation for day 16. Used List.unfold probably for first time, referred a lots of F# solutions posted here, learning a lot, Thanks again.

  • Advent-of-code-2021

    C solutions to AoC 2021 (by rprtr258)

    C

  • AdventOfCode2021

  • advent-of-code-2021

    https://github.com/fbl100/advent-of-code-2021/blob/master/day_16.py My first attempt at this was really ugly. The second attempt used a buffer that keeps track of the current position, which was much cleaner and resulted in everything just 'falling into place'. I say that until I got the part 2 answer wrong. I had to figure out why a negative number was getting into the mix on my evaluations. Check line 221-223 if you're interested.

  • aoc-2021-in-kotlin

  • Advent_of_Code

    My Advent of Code solutions.

    My solution in Python. This one was fun! Thanks for the many samples and the detailed description.

  • aoc

    Solution

  • AdventOfCode2021

    Advent of Code 2021 challenge: 13 different languages, one chosen at random every day! (by Qualia91)

  • advent-of-code

    My Advent of Code submissions (by DecemberDream)

    Python day 16. In part 1 I apparently do the parsing from hex to binary wrong, however, it works. This gave me problems in part 2 so I reworked that (and the rest of the code).

  • advent-of-code-go

    (All 7 years of) adventofcode.com solutions in Go

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