-🎄- 2021 Day 14 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
  • adventofcode

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

  • advent-of-code-solutions

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

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

  • aoc2021

    Advent of Code 2021 (by ednl)

    C code. I'm afraid I went a little overboard with double checking everything. Are there even pairs for which no rule exists? If there are, I'm good :) Runs very fast in 180 µs on a Pi 4 @ 1.8 GHz:

  • advent-of-code

    I wrote this bottom-up DP solution, and it's not a dead end :)

  • adventofcode

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

    TypeScript, no string manipulation, kept two maps, count of pairs from last step, and count of polymers, took just a counter change for part 2.

  • adventofcode

    Advent of Code solutions (by mcpower)

    Python, 8/28. Part 1, Part 2. My part 2 turned the input into "a Counter of adjacent pairs of characters", which you need to be careful about because turning that to "a Counter of characters" is not easy - you double-count all characters except for the first and last which cost me an incorrect submission!

  • advent-of-code

    Advent of Code (by morgoth1145)

    Python 73/287

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

  • AdventOfCode

  • adventofcode

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

    My Scala solution.

  • Advent-of-Code-2021

    Advent of Code Solutions 2021 in Python (by DenverCoder1)

  • aoc2021

  • Solutions in C++: Part 1 Part 2

  • AdventOfCode_2021

    Repository for Advent of Code 2021 solutions (by galenelias)

  • AdventOfCode-Java

    adventOfCode(Language.JAVA);

  • aoc2021rust

    Rust. Ended up doing it recursively, like last time. 4ms on part 2; pretty sure that's because I keep cloning hashmaps.

  • aoc2021

    Advent of Code 2021 Solutions (by nlowe)

    Go 1449/3191

  • aoc

    Advent of Code solutions in Go (by sebnyberg)

    Go (search: golang)

  • Part 1 & 2 Optimized

  • advent-of-code

    Advent of Code solutions in JS (by leyanlo)

  • advent-of-code

    Perl I expected second part to make a surprise and do something different than just increase number of loops - but It didn't :)

  • AdventOfCodePython

    My attempts to solve the Advent of Code puzzles in Python. I've just started to study Python in a bit more detail, so I am playing around with it and try to learn some of its advanced functionality.

    Python:

  • deno_aoc

    🎄 Advent of code solutions written in TypeScript for Deno.

  • AOC2021

    F# solutions to the 2021 Advent of Code challenges (by nicklecompte)

    Some F# since it's pretty underrepresented: https://github.com/nicklecompte/AOC2021/blob/main/AOC2021/Day14.fsx

  • advent-of-code-2021

    AOC 2021 (by timfennis)

  • advent-of-code

    Common Lisp. Pretty bad day, stumbled around for like an hour trying to actually construct the strings for part B and then finished in like 10 mins once I realized how to take the better approach :/

  • advent-of-code-2021

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

  • Kotlin

  • advent_of_code_2021

    It's a simple iteration in yours, I like it. I complicated things by recursing and maintaining letter counts the entire time.

  • AdventOfCodeCSharp

    My AoC Solutions

  • AoC2021

    Advent of Code 2021 in F# (by kimvais)

    In the end it turned out pretty nice

  • AdventOfCode2021

    My solutions for https://adventofcode.com puzzles (2021) (by ClouddJR)

    All solutions

  • aoc2021

    Advent of Code 2021 (by UnicycleBloke)

  • aoc2021

    Advent of Code 2021 - my answers

    Kotlin, Python, and Rust are all following the same pattern.

  • AdventOfCode2021

  • advent_of_code_2021

    Rust solution

  • advent-of-code-2021

  • AoC2021

    Advent of Code 2021 (by gereons)

  • aoc2021

    python

  • AdventOfCode2021

    Cleaned up code: [email protected]

  • AdventOfCode2021

    Solutions for Advent Of Code (by MichelBillaud)

  • AdventOfCode2021

    C#

  • aoc-2021-fsharp

    My F# solutions for Advent of Code 2021 https://adventofcode.com/2021

    F# https://github.com/bainewedlock/aoc-2021-fsharp/blob/master/aoc-2021-14/Solution.fs

  • adventofcode-21

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

    For first part implemented the task logic actually calculating the polymer each iteration. This was slow enough for part 2 so had to scratch my head for a while.

  • AdventOfCode_2021

    Repo for the 2021 edition of www.adventofcode.com (by LubosKolouch)

  • Advent-of-Code-2021

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

    I'm not sure what kind of brainfog descended on me this morning. After part 1 I instantly knew I should just count the pairs and update their numbers but somehow couldn't figure out how to do it. It took me almost an hour before it dawned on me that...wait for it...a pair splits into two pairs. After that and some off-by-one debugging I came up with this solution. Defaultdict for the win.

  • aoc2021

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

    Elixir

  • adventofcode

    adventofcode.com solutions (by linl33)

  • AdventOfCodeHaskell

    Advent of Code in Haskell

  • Advent_of_Code_2021

    My solutions to Advent of Code 2021 (by neelakantankk)

    Python

  • adventofcode

    Advent of code solutions (by mathsaey)

  • Advent-of-Code

    bad christmas spaghett (by YelovSK)

    GitHub link - keeping track of pair counts and character occurences.

  • advent_of_code_2021

    I had the same approach. A bit different details in the end (double counting yadda yadda). Here is my code!

  • AdventOfCode

  • advent-of-code-2021

    🦀 Rust solutions to AoC 2021 (by wfxr)

    Optimized Rust Solution

  • advent-of-code-2021

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

  • aoc-2021

    ADvent of Code 2021 (by TenViki)

    Part 1 of course generating all the strings Part 2 reworked :D Visualization here: https://www.reddit.com/r/adventofcode/comments/rg5h8e/2021_day_14_visualization_with_a_chart/ Source code for both parts: https://github.com/TenViki/aoc-2021/tree/main/14

  • advent-of-code-2021

    zig solutions to advent of code 2021 (by jchevertonwynne)

  • aoc2021

    Advent of code 2021 (by oleg-prikhodko)

    My solution in javascript

  • aoc2021

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

  • sea

    Sketches (by nuoxoxo)

    C++\ Part 1 was brute forced at the beginning. Both parts were rewritten to get part 2.\ I think the lesson is to think DP-wise right away as soon as you notice the structure gets bigger real quick

  • advent-of-code

    My contribution to the Advent of Code (by yalit)

    My solution here : in typeScript (a bit too verbose... but hey, it's working :D)

  • Advent-of-Code

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

    Python 3.10 (source with docstrings)

  • AdventOfCode2021

    My solutions for AdventOfCode 2021 (by FluffyGameDev)

    My C++ Solution

  • advent-of-code-2021

    In Common Lisp (by brunal)

  • adventofcode

    Advent of code solutions (by julian-west)

    Python day 14 solution (GitHub). Tried splitting out the logic into individual functions to aid readability.

  • aoc2021

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

  • Advent-of-code

    My solutions of adventofcode.com (by MichalMarsalek)

    using my templates.

  • AOC2021

    advent of code 2021 (by zalazalaza)

    < 30 lines of python

  • advent-of-code-2021

    AOC in go (by alextanhongpin)

  • adventofcode

    Answers to Advent of Code (by viceroypenguin)

  • 2021-advent-of-code

    Advent of Code 2021 puzzles

  • advent-of-code

    My solutions to the Advent of Code (by aaronreidsmith)

    Scala. Would have been a lot easier in Python with a proper Counter class. This isn't super idiomatic (i.e., functional) Scala, but it gets the job done

  • Advent_of_Code2021

    Solutions to Advent of COde 2021 (by cettt)

    cleaned up my code a little. Both parts run in 40ms. Full code with comments is on github

  • adventofcode

    Advent Of Code 2021 (by urvil38)

  • Advent-of-Code-2021

    GitHub/Polymerizator.java

  • aoc-2021

    Advent of code 2021 challenges written in Rust to learn the language and get more comfortable with the it (and sometimes I just use C++) (by tglane)

    Rust First time working with Rust on this years challange so its probably not idiomatic but im trying to get more comfortable with it. Feedback is welcome

  • advent-of-code

    Advent of code solutions (by rbusquet)

  • Advent-of-Code-2021

    Advent of Code 2021 solutions in Matlab (by j-a-martins)

    GitHub [Source w/ comments] [Execution profile for 40 steps]

  • AdventOfCode

    Advent of code daily challenge (by WilliamLP)

  • aoc

    Advent of Code Solutions (by joeyemerson)

  • advent-of-code-2021

    Rust solutions of Advent of Code 2021 (by MrRobb)

    Rust: Solution

  • adventofcode2021

    Python 3.10 solutions, standard library only

  • aoc-2021

    Advent of Code 2021 with C#/LINQ (by jasonincanada)

    C# solution, I keep letter pair counts in a square grid and a separate map for individual letter counts

  • AdventOfCode

    repo

  • Advent-of-Code

    Advent of Code (by michaeljgallagher)

    Tricky memoization / dp problem today

  • AdventOfCode2021

  • advent-of-code

    My solution in Go

  • advent_of_code

    All of my :star: Advent of Code 2021 solutions - using Elixir (by wasi0013)

    y2021/day_14.ex

  • AOC2021

    Quick n dirty C# (by oflahero)

    C#. 15ms avg for part 2. Insight is to maintain a single letter frequency count AND a letter pair frequency count.

  • advent-2021

  • aoc2021

    Solutions for Advent of Code 2021 (by arturhoo)

  • advent-of-code-2021

  • adventofcode

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

  • AdventOfCode

    C# source P2 Runs in about 800 us avg. Using a tokenized dictionary after I ran out of memory once building strings. The lanternfish strikes back

  • adventofcode

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

  • AdventOfCode

  • adventofcode

  • aoc-2021

    Advent of code solutions 2021 (by 770grappenmaker)

  • aoc-2021

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

    Egel, the element count is just either the sum of all (_,B) counts plus 1 for the head of the template, or the sum of all (A,_) counts plus 1 for last of the template. Just project on either the first or the second element.

  • AOCday14

    solution for Advent of code, day 14, 2021

  • advent-of-code

    Advent Of Code Solutions (by sreedevk)

  • advent-of-code-2021

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

  • advent-of-code-2021

    Advent of Code 2021 (by cylab)

  • aoc-2021

    Advent of Code 2021 (by zookini)

  • aoc

  • advent-of-code

    My Advent of Code submissions (by DecemberDream)

    Python day 14 where part 2 is a bit messy but it seems to be very efficient.

  • aoc-2021-in-kotlin

  • aoc2021

  • aoc2021

    Advent of code 2021 in Kotlin! (by crnkofe)

  • This was a bit difficult. My original part one solution worked completely differently to what I had to do for part two.

  • advent-of-code

    Advent of code solutions (by tallbikeguy)

  • AdventOfCode2021

    Advent of code 2021 (by marcodelmastro)

  • adventOfCode2021

    Github Link

  • advent-of-code

    My Advent of Code solutions (by sk1talets)

    Node.js solution

  • AOC2021

  • coding_challenges

    Various Coding challenges with my solutions (by BigPeet)

    Package with everything

  • aoc-typescript

  • AdventOfCode

    My solutions to Advent of Code (by DanaL)

    C# code on github

  • Advent-of-code-2021

    C solutions to AoC 2021 (by rprtr258)

    C solution.

  • adventofcode

    My solutions to the Advent of Code challenges (by djotaku)

    Compare my part 1 answer to see what I mean.

  • advent-of-code-2021

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

    See solution: https://github.com/tcc-sejohnson/advent-of-code-2021/tree/main/14

  • AdventOfCode2021.jl

    Advent of Code 2021 in Julia

  • AoC2021

    Advent of Code 2021 in GO (by HalfInner)

  • advent-of-code

    A repository for all my advent of code solutions (by jcreek)

    This is literal witchcraft to me! How on earth did you get this to run instantly for 40 steps when mine essentially just uses a linkedlist instead of a dictionary and takes hundreds, if not thousands of hours and TBs of RAM to run? https://github.com/jcreek/advent-of-code/blob/master/2021/14/Program.cs

  • AdventOfCode2021

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

    C# Github Part two took me some head scratching, got to one off the right answer but ended up needing a pointer from the sub for the trick of initializing the element count and counting additions only. Also I had spoilers before this that part two would be ridiculous after all the lantern fish memes, but I felt I should do the brute force approach for part 1 anyway.

  • advent-of-code-2021

  • AdventofCode

  • advent-of-code-2021

    Trying to solve https://adventofcode.com/2021 (by ThePituLegend)

    I was stuck on the counting part (after being stuck in the How should I solve the massive string being massive? part hahaha). So I finally came here for some hints, and found your code. And this comment saved the day: # The only new character we've added to the overall string is the new # added element. The quantity is the same as the pair that generated it # For example, 25 ABs will generate 25 new Cs if the rule is AB -> C Actually I'm kinda scary because our codes are fairly similar :p There's some simplifications/contractions/tricks maybe you'll benefit from (even though my code is far from perfect in its tricks): https://github.com/ThePituLegend/advent-of-code-2021/tree/main/day14

  • aoc_solutions

    Ruby solution optimized (~8ms to print both parts) by precomputing 41,000 values

  • advent

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

  • AdventOfCode

    Python

  • adventofcode

    Advent of Code! https://adventofcode.com/ (by dfontana)

    Rust in ~600us

  • advent-of-code

    Solutions for Advent of Code, in TypeScript. (by Awjin)

    Github source, with documentation. I solved this using a level-order traversal of the graph of inserted polymers.

  • Advent-of-Code-2021

    Rust

  • advent_of_code

    Solutions to programming puzzles on Advent of Code (by Praful)

    Below is the new solution, which works for part 1 and 2. The full code is on GitHub.

  • AdventOfCode2021

  • aoc-2021-clj

    Clojure, source and tests. Brute forced part 1 but refined the solution for part 2 which runs in about 30ms (not bad, I'd say!).

  • AdventOfCode2021

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

  • CodingExercises

    A variety of coding exercises for practice and to learn new languages

    Part 1 (Rust) - pretty simple.

  • A bit late, but I got there in the end. Using the same "counting pairs" trick as everyone else. Writeup on my blog and code on Gitlab.

  • aoc

    Python, with imports of any library. Part 1, inefficient and slow. Part 2 using try/except statements and pair counting, quite fast I find it.

  • Advent_of_Code

    My Advent of Code solutions.

    My Solution in Python. This one is pretty compact and amazingly fast thanks to collections.Counter and functools.lru_cache. Here is the function for counting the elements:

  • AoC2021

    Advent of Code 2021 (by travis-miller)

    Golang Part 1 using brute force Part 2 using memoization

  • AdventOfCode2021

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

  • 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