-🎄- 2021 Day 22 Solutions -🎄-

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

Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • JetBrains - Developer Ecosystem Survey 2022
  • aoc2021

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

    How about a python translation of my haskell solution?

  • adventofcode

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

    F#, Converted TypeScript solution to F#, List.choose made it more easy. Under 80 lines part 2 only code with Type specific modules.

  • 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.

  • adventofcode2021

    Advent of Code 2021 in Elixir (by hermanstehouwer)

    Seems plenty fast though! And I get nice trees of cubes and their subcubes that are lit. https://github.com/hermanstehouwer/adventofcode2021/blob/main/lib/cube.ex if you are interested.

  • advent-of-code-2021

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

    My subtraction algorithm always generates 6 cuboids, except when there is no intersection. It then discards the ones with size 0.

  • aoc2021

    Advent of Code 2021 (by ddrcoder)

    Rust, 286/106. I just compressed the volume by every distinct coordinate, then summed up all the dx * dy * dz subvolumes. Only required 500MB of RAM! Could've been 8x less with bitvec.

  • aoc21

  • advent-of-code-2021

    My solutions for Advent of Code 2021: https://adventofcode.com/2021 (by BradonZhang)

    Python (140/111)

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • advent-of-code-2021

    Learning rust (by platers)

    Rust

  • AoC

    Solutions to Advent of Code. (by lucifer1004)

    Pluto.jl notebook (requires your AoC session to fetch your input)

  • adventofcode

    :christmas_tree: Advent of Code (2015-2021) in C#

  • aoc2021

    My thoughts exactly. I did the cube sub-division thing. In order to not get lost, I directly wrote "clean", tested classes for 1D range and cubes. Overall it was a smooth ride, got me my personal best (1232nd), but at the cost of >20s execution time! Now I feel humbled by the solutions I'm seeing here.

  • Advent_of_Code_in_Pascal

    My solutions to the Advent of Code, in Free Pascal

    Free Pascal - 2251/1744 34.5 seconds runtime No objects, no recursion After brute forcing part 1, I stared at part 2 until I though only handling the different values of X,Y,Z and letting the grid represent variable size cubes.. only to hit memory size limits anyway... and then I learned how to use BITPACKED array, and was able to eventually brute force part 2. Whew!

  • adventofcode

    Advent of Code challenge solutions (by flwyd)

    Raku 5216/1574.

  • aoc2021

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

    Elixir, Python 1708/791

  • AOC_2021

    My solutions to the AdventOfCode for 2021 (by MarcusTorndahl)

    Python

  • AdventOfCodeCSharp

    My AoC Solutions

    C# 3039/1750

  • aoc_bp

    My AOC boilerplate

    JS 727/2619, but was interrupted for ~3 hours doing part 2.

  • advent2021

    Advent of Code 2021 (by arjanIng)

  • AdventOfCode

    My solutions for Advent of Code (by Eckankar)

    Code available on GitHub.

  • aoc2021-rust

    Advent of Code 2021 - Written in Rust (by dclamage)

    Rust

  • advent2021

  • advent-of-code-2021

  • advent-of-code

    Advent of Code (by nikolay)

    My solution in Go. The first part is ugly but wanted to do it faster.

  • AdventOfCode2021

    I came up with a similiar solution, but i forgot to include the possibility for multiple turn offs and ons, so your solution helped me out form my own. However, I somehow still get the wrong answer, if anyone could help me I'd really appreciate it :D https://github.com/ckainz11/AdventOfCode2021/blob/main/src/main/kotlin/day22/Day22.kt

  • aoc2021

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

  • advent-of-code-2021

    Advent of Code 2021 Solutions (by jerchende)

  • advent-of-code-2021

    In Common Lisp (by brunal)

  • Advent_of_Code2021

    Solutions to Advent of COde 2021 (by cettt)

    My code is not yet as efficient as it could be: i takes about 4-5 seconds for both parts.

  • advent-of-code-2021-rs

    Advent of Code 2021 solutions in Rust

  • misc

    A scrapyard for miscellaneous files which belong to no project (by rhysd)

    Rust

  • aoc-2021

    Advent Of Code 2021 (Solutions) (by codemonkey-uk)

  • Advent-of-Code

    Advent of Code (by michaeljgallagher)

    Should've seen that coming in part two

  • aoc21

    ⭐️ Complete Advent of Code 2021 solutions in Go. (by GreenLightning)

    Golang

  • AoC2021

    I used the same basic idea in my non-recursive solution. However mine is MUCH slower, probably because it requires a lot of list manipulation that isn't necessary in the recursive approach.

  • advent-of-code

    My solutions for the Advent of Code (by JesperDramsch)

    In the rest of the code I simply iterate through cubes and multiply the edges with the saved values.

  • AoC

    my personal repo for the advent of code yearly challenge (by Fadi88)

    rust

  • advent-of-code

    Advent of Code solutions in JS (by leyanlo)

  • adventofcode

    my adventofcode solutions... (by hsegnitz)

    PHP

  • AdventOfCode

    Advent of code daily challenge (by WilliamLP)

  • aoc-2021

    Advent of Code (AoC) 2021 solutions (by egel-lang)

    Well, I ain't proud of today but it is what it is. Egel code for day 22, task 2, and a with pretty colors.

  • adventofcode2021

  • advent2021

    My solutions to the Advent of code 2021 (by jacopofar)

    Python takes around 1 minute for both parts, no extra libraries.

  • deno_aoc

    🎄 Advent of code solutions written in TypeScript for Deno.

    Here’s pretty much the same thing translated to TypeScript: https://github.com/N8Brooks/deno_aoc/blob/main/year_2021/day_22.ts

  • advent_of_code

    Haskell (Part 1 only)

  • AdventOfCode2021

    My solutions for the https://adventofcode.com/2021 challenge. (by Finomnis)

    Ha! I had the same idea. I feel smart now :) Rust

  • advent-of-code-2021

    Python: set arithmetic... with cubes

  • aoc

    Advent of Code 2020 in Nelua (by edubart)

    My Solution

  • AdventofCode

    Advent of Code Solutions (by IamfromSpace)

    warning, code is crazy ugly

  • aoc2021

    My solutions to Advent of Code 2021 (by janek37)

    Your first idea wasn't that bad, if you just figured out a smarter way to generate less cuboids, like in this solution or in mine.

  • adventOfCode

    Advent of Code solutions in a number of different languages (by codemicro)

    Witness the weirdness for yourself at this here link: https://github.com/codemicro/adventOfCode/tree/master/challenges/2021/22-reactorReboot (includes screenshots)

  • advent-of-code

    Advent of Code Solutions (by karjonas)

    Rust GitHub. My approach is to go through all cuboids and always remove their intersection with all previously added cuboids. Then, If it is a "on" cuboid it is added to the list of cuboids. This way no cuboids will overlap and I can sum all their volumes in the end.

  • aoc2021

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

  • aoc2021

  • advent-of-code

    full code

  • advent-2021

  • adventofcode

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

  • aoc2021

    Advent of Code 2021 - my answers

    Kotlin, Python, and Rust solutions are the same solution but much uglier.

  • adventofcode2021

  • advent-2021

    Rust https://github.com/Crazytieguy/advent-2021/blob/master/src/bin/day22/main.rs Imagining the geometry of this was very tricky for me. For a while I contemplated if calculating the intersection of each pair of cuboids would give me enough information to know how many cubes are on at the end, and finally decided that I would also have to calculate the intersections of those and so on, so I gave up. Instead I decided that my state will be a vector of cuboids that are garuanteed to be non overlapping, and on each command I would subtract the current cuboid from each of these non overlapping cuboids (leaving 1 to 6 cuboids depending on intersection), and finally either add in the current cuboid (for on command) or leave it out (for off).

  • advent-of-code-2021

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

  • adventofcode2021

    My solutions to Advent of Code 2021. (My first completed AoC!) (by terminalnode)

    Anyone got any ideas why it may fail? Here's my solution. Input data is here and I've triple checked that it's pasted correctly.

  • aoc2021

    advent of coding zig (by Kiraffi)

    Zig

  • aoc-2021-cpp

    Advent of Code 2021 in C++

  • advent_of_code_2021

    Golang solutions to advent of code 2021 (by Stefansfrank)

    I think my part 2 is one of the simplest solution I have seen so far and still runs decently fast (200 ms on my MB Pro) - even though there are many much faster on here.

  • AdventOfCode2021

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

  • Advent-of-Code-2021

    Advent of Code solutions (or failures) for 2021 (by phord)

    Python

  • AoC_2021

    advent of code 2021 (by jwezorek)

    code here on github

  • adventofcode

    Answers to Advent of Code (by viceroypenguin)

  • adventOfCode

    Rust

  • adventofcode

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

    thank you! this is the most easy and straightforward approach to this problem. the only downside is the speed — it's not great. my golang solution takes almost 2 seconds to compute final answer.

  • adventofcode

    Advent of code solutions (by mathsaey)

  • advent-of-code-solutions

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

  • AdventOfCode2021

  • advent_of_code

    :christmas_tree: Advent of Code 2021 in Kotlin :christmas_tree: (by jacob-locker)

  • Advent_of_code_2021

    Rust solutions for advent of code 2021 (by Harshsa28)

    holy shit, your solution is amazing. It's so clear. It took me a day and a really complicated solution to get the answer in more than 5 mins runtime (https://github.com/Harshsa28/Advent_of_code_2021/blob/main/src/22.py).

  • AdventOfCode2021.jl

    Advent of Code 2021 in Julia

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