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

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

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. deno_aoc

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

    Yeah it's possible with a stack based approach: https://github.com/N8Brooks/deno_aoc/blob/main/year_2021/day_12.ts

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. adventofcode

    Advent of Code challenge solutions (by flwyd)

    Raku, much cleaner (part 1 and part 2 are tiny, and the base class DFS method is a lot cleaner) and also 20x faster with memoization. Took several tries to realize what key could be used for memoization; I ended up using the whole "budget" multisetwhich handles all the variants of small caves that can/can't be used after this one.

  4. adventofcode

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

    TypeScript used strategy pattern and a single function to find paths for part 1 and 2.

  5. aoc

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

    Another Raku version, see GitHub, using DFS instead of recursion (inspired by many people on this thread).

  6. advent-of-code

    Anyway, here was my solution where I mapped in order to resolve that problem, and then had to write a recursive β€œuntangle the mess function” haha: https://github.com/ttilberg/advent-of-code-2021-rb/blob/main/2021/12/2.rb

  7. aoc

    Advent of Code (by c-kk)

    Now it runs in 0.3 milliseconds! See: https://github.com/c-kk/aoc/blob/master/2021-go/day12-dfs/solve.go

  8. aoc2021

    Advent Of Code 2021 solutions (by constb)

    Github: Part 1 Part 2

  9. SaaSHub

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

    SaaSHub logo
  10. advent-of-code-go

    All 10 years of adventofcode.com solutions in Go/Golang (and a little Python); 2015-2024

  11. AdventOfCode2021

  12. AdventOfCode_2021

    Repository for Advent of Code 2021 solutions (by galenelias)

  13. AdventOfCode

    Hacky solutions for https://adventofcode.com (by AllanTaylor314)

    Python3 (218/98)

  14. advent-of-code

    My Advent of code files (by timrprobocom)

  15. aoc

    Advent of Code (by quickthom)

    Python 3 (1575/2551)

  16. adventOfCode2021

    Full Code for both parts

  17. aoc-2020

    Awful code that implements the challenges from https://adventofcode.com/2020/ (by Heleor)

  18. advent-of-code

    My solution in Common Lisp, 2335/2041.

  19. AdventOfCodePython

    Python solutions for Advent of Code puzzles 2015-24.

    Python: https://github.com/mkern75/AdventOfCodePython/blob/main/year2021/Day12.py

  20. aoc

    πŸŽ„ advent of code 414⭐ (by MasterMedo)

    I think there's no faster algorithm, but I think you can improve the execution time by reducing the number of comparisons you do. Check out my solution.

  21. AdventOfCode

  22. advent-of-code-2021

  23. adventOfCode

    C#

  24. advent-of-code-2021

    AOC in go (by alextanhongpin)

  25. aoc2021

    Advent of Code 2021 Solutions (by nlowe)

    Go, 3030/3121

  26. adventofcode-solutions-js

    Github

  27. advent-of-code

    My solutions to Advent of Code (by daniel-dara)

    Part 1 - 35

  28. adventofcode2021

    Solutions to Advent of Code 2021 (by a-mroz)

    Python3.

  29. comp

    Ruby

  30. AdventOfCode

    Sharing Advent of Code Exercises (by shouchen)

  31. AdventOfCode2021

    My solutions to advent of code 2021. Will keep updating as the event progresses. (by abhimanyu891998)

    https://gist.github.com/abhimanyu891998/99ba1eaed81da9d8f063c07c70cf43a1

  32. perlweeklychallenge-club

    Knowledge base for The Weekly Challenge club members using Perl, Raku, Ada, APL, Awk, Bash, BASIC, Bc, Befunge-93, Bourne Shell, BQN, Brainfuck, C3, C, CESIL, C++, C#, Clojure, COBOL, Coconut, Crystal, D, Dart, Dc, Elm, Emacs Lisp, Erlang, Excel VBA, Fennel, Fish, Forth, Fortran, Gembase, GNAT, Go, Haskell, Haxe, HTML, Idris, IO, J, Janet, Java, JavaScript, Julia, Kotlin, Lisp, Lua, M4, Miranda, Modula 3, MMIX, Mumps, Myrddin, Nim, Nix, Node.js, Nuweb, OCaml, Odin, Ook, Pascal, PHP, Python, Post

    Perl. As luck would have it there was a The Weekly Challenge not too long ago in which I used a similar approach of using partial paths as a hash key.

  33. advent

    advent of code (by jasontconnell)

  34. aoc2021

    Discontinued Advent of code 2021 [GET https://api.github.com/repos/oleg-prikhodko/aoc2021: 404 - Not Found // See: https://docs.github.com/rest/repos/repos#get-a-repository] (by oleg-prikhodko)

    Recursive javascript solution using Set and custom counter: https://github.com/oleg-prikhodko/aoc2021/blob/master/12.js

  35. advent-of-code

    Common Lisp. Got bit really hard twice today, on part a by not knowing that equalp compares strings case-insensitively (wtf!?) and on part b by speedreading and thinking that all small caves could be revisited on a single path

  36. Advent2021

    Fairly straightforward recursive solution: https://github.com/IdrisTheDragon/Advent2021/blob/main/day_12/day_12.py

  37. aoc2021

    Solutions to AOC2021 in Python. (by jdgunter)

    I have a similar solution, except I did the recursive DFS instead of an iterative one: https://github.com/jdgunter/aoc2021/blob/master/12/12.py

  38. aoc2021

  39. advent-of-code

    Advent of Code solutions in JS (by leyanlo)

    Iterative solution. Took me a few hours to clean this up into something presentable, but pretty happy with how it turned out. GitHub

  40. adventofcode

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

    My Scala solution.

  41. aoc2021

    C++ https://github.com/ileonte/aoc2021/blob/main/day12/main.cpp

  42. adventofcode

    I left the types in this time so just the imports are missing.

  43. adventOfCode2020

    Advent of code (by MissMormie)

  44. AoC2021.jl

    Solution to Advent of Code 2021 in Julia (by abraemer)

    Julia

  45. AdventOfCode2021

    Advent of code 2021 (by marcodelmastro)

  46. aoc2021

    Advent of code 2021 in Kotlin! (by crnkofe)

  47. aoc2021

    Advent of Code 2021 (by sotolf2)

  48. aoc2021

    Advent of Code 2021 - my answers

    Haskell 2873/1767

  49. fgl

    A Functional Graph Library for Haskell

    Using fgl but only as a data structure this time, with edge labels denoting whether the target is a big room. Not using any of its algorithms as it doesn't have anything built-in for "traversal with re-visiting".

  50. submarine

    AdventOfCode 2021

  51. adventofgo

    advent of code in go (by jdrst)

    Go/Golang

  52. advent-of-code-2021

    advent of code 2021 solutions (by simorautiainen)

    Python solution. If you look at the input you might notice that there is not a single path from uppercase cave to uppercase cave, so with recursion there is no way code can get stuck. It also means that you don't need to keep track of the finished paths because there is no way to generate duplicates.

  53. advent-of-code-solutions

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

  54. advent-of-code

    Mine takes 2ms: https://github.com/SvetlinZarev/advent-of-code/tree/main/2021/aoc-day-12

  55. adventofcode

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

  56. advent-2021

    Went for optimization on this one. All strings are converted into ints (first becomes 0, second becomes 1, etc.), allowing me to use a vector instead of a hashmap for faster lookup times.

  57. advent-of-code-2021

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

  58. adventofcode

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

  59. advent-of-code

    Advent of Code in python3 (by lehippie)

    Python3 : https://github.com/lehippie/advent-of-code/blob/master/2021/12.py

  60. adventofcode

    Advent of code solutions (by mathsaey)

  61. adventofcode-2021-solutions

    Solutions for Advent of Code 2021 edition

  62. AoC2021

    Advent of Code 2021 (by gereons)

  63. advent-of-code

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

    TypeScript

  64. AoC

    Discontinued Advent of Code submissions (by tomribbens)

    My Python solution is available on my Github

  65. adventofcode

    Advent of Code solutions (by alchemyst)

    Python on github

  66. aoc2021

    Rust. I made it terribly ugly and unreadable while attempting to speed it up. That worked I think, part 2 runs in 0.015s on my laptop. The main trick was converting all caves from strings to power of 2 integers. That way, instead of storing a list of visited caves, you can use a single integer and do bitwise comparisons to check if you've visited a cave before.

  67. advent-2021

    πŸŽ„ Advent of Code 2021: Solutions in Scala

    Scala

  68. advent_of_code

    Solutions to adventofcode.com (by ankitsumitg)

    Reusable method for both part 1 and 2: GIT Link

  69. advent-of-code

    My solutions to Advent of Code (by deiwin)

    In case it's helpful, I found the solution to be quite comfortable to write in Haskell today. No special libraries used: https://github.com/deiwin/advent-of-code/blob/main/2021/Day12.hs

  70. I didn't read part two right for literally two hours... but eventually I did! Solution in python!

  71. AdventOfCode

    Advent of Code Solutions (by auxym)

  72. Advent-of-Code

    Advent of Code (by michaeljgallagher)

    A nice twist on a classic problem! And part two was a nice little modification from part one. Neat problem today

  73. aoc2021

    Advent of Code, 2021 (by gkwaerp)

    SWIFT

  74. AdventOfCode2021

  75. adventofcode

    Some flavors of implementations for the Advent of Code challenges (by gansanay)

    Python 3, to be cleaned a bit

  76. AdventOfCode

    Versions with `Write-Verbose` lines can be found on my AoC github here: part1 &part2

  77. AOC

  78. advent-of-code-2021

    It's back. It's worse. (by mrwilson)

    Went for a recursive BFS method (Source and tests), only a minor change from part 1 to part 2

  79. advent-of-code

    Advent of code solutions (by rbusquet)

  80. aoc2021

    Source (~16 LoC but v. slow :))

  81. AOC2021

    Advent of code solutions 2021 (by calebwilson706)

  82. aoc-2021-fsharp

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

  83. aoc2021

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

  84. coding_challenges

    Various Coding challenges with my solutions (by BigPeet)

  85. aoc

    My solutions to adventofcode.com (by ciscou)

    My solution in 50 lines of ruby: https://github.com/ciscou/aoc/blob/master/2021/12.rb

  86. aoc2021

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

  87. adventofcode

    Incomplete list of some of my AoC solutions (by Dav1dde)

    Rust: Day 12

  88. advent_of_code_2021

    My solutions to the challenges from Advent of Code 2021 (by pierrechevalier83)

    [Rust solution](https://github.com/pierrechevalier83/advent_of_code_2021/blob/main/src/day12.rs)

  89. Advent-of-Code-2021

    GitHub/PathFinder.java

  90. adventofcode

    Advent of code (by Peter554)

    Full solution

  91. advent-of-code-2021

    πŸŽ„ My Advent of Code solutions in Rust. http://adventofcode.com/2021

    Part 1 0.861ms (861ΞΌs)

  92. advent-of-code

    My Advent of Code answers (by tcsullivan)

    Clojure (GitHub). My first solve of part 2 took ~15 mins, given 1GB of stack and 4GB of heap. Finally found the bottlenecks (concat) and got it down to 8-ish seconds:

  93. AoC2021

    Advent of Code 2021 in F# (by kimvais)

    So pretty compared to my spaghetti

  94. advent-of-code-2021

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

  95. Advent-of-Code-2021

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

    GitHub

  96. aoc

    Advent of Code Solutions (by joeyemerson)

  97. advent-of-code

    Part 1 Part 2

  98. advent-of-code

    Solving Advent of Code (by pemoreau)

  99. advent-2021

    C# Today. Solution here.

  100. aoc2021

    Js/Ts Part1&2

  101. AdventOfCode

    C# solutions for Advent of Code (by Rekkonnect)

  102. advent-of-code

    Advent of code solutions (by tallbikeguy)

  103. adventofcode

    Answers to Advent of Code (by viceroypenguin)

  104. aoc2021

    Advent of Code 2021, in Rust (by Killavus)

  105. rockstar

    Home of the Rockstar programming language

    Using a language known as Rockstar.

  106. advent-2021

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

    Rust https://github.com/Crazytieguy/advent-2021/blob/master/src/bin/day12/main.rs At first I used a HashSet to keep track of which caves were visited, and it worked fine. As a fun challenge I wanted to avoid cloning on each recursion, so now each cave has an index and I keep which ones were visited in an array of bool.

  107. aoc-2021

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

    C# solution with basic graph search. I track the step counts to each cave and decide which next caves to take based on them, and prune it after returning from a recursive call to SearchFrom

  108. aoc2021

    Advent of Code 2021 (by TheJare)

  109. Main logic util.py for both parts (part 1 and part 2)

  110. advent-of-code

    My solutions for the Advent of Code (by JesperDramsch)

    Python 3. Figured I'd learn some more networkx. Was useful for the "smol" attribute in the end and easily getting the neighbors. Full code is on Github.

  111. advent-of-code-2021

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

  112. aoc-typescript

  113. advent-of-code

    Solutions for Advent of Code 2017 in javascript (ES6) (by Akallabet)

    Solution in Javascript, this one was so painful, I did use google quite a lot and try for so many hours and at the end the solution became incredibly simple

  114. Advent-of-code-2021

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

  115. AdventofCode2021

  116. advent-of-code-2021

  117. AdventOfCode2021

    Also, decided to have a look at what the graph looked like with networkx

  118. adventofcode

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

  119. advent-of-code-2021

    github part 2 commit at part 1

  120. adventofcode2021

    Solution on GitHub

  121. icpcPrep

    Storage of competitive programming solutions

    Part 1 link Part 2 link (~5ms optimized)

  122. aoc-2021-in-kotlin

  123. AOCday12

    solution for AOC day 12

  124. AdventOfCode2021.jl

    Advent of Code 2021 in Julia

  125. AdventOfCode2021

    Advent of code solutiosn (by McSick)

    Rust: https://github.com/McSick/AdventOfCode2021/blob/main/12/tree-pathfind/src/main.rs Been optimizing and didn't even consider the release option. Debug mode ~3-3.5s. With release mode, part 2 runs in 0.35s including loading the input. Nice! Also did something unique than others and rewrote mine to use an adjacency matrix.

  126. roast

    πŸ¦‹ Raku test suite

    Recursive solution in Raku.

  127. advent-of-code-2021

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

  128. Advent-of-Code-2021

    Advent of Code Solutions 2021 in Python (by DenverCoder1)

  129. CodingExercises

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

    My Rust solution

  130. AdventOfCode2021

  131. AdventOfCode2021

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

  132. The complex rules made this a bit fiddly to write. Writeup on my blog and code on Gitlab.

  133. adventofcode

    Gok's Advent of Code Repo (by gokberkkocak)

    Hmm, interesting! I'm definitely not getting the input on compile time either. I'm using a function in my util mod to either get it from the web (for the first time and store it) or read from a file (I did the flamegraph not on the first run). I see you are using std::fs::read_to_string to read your file. I'm using another method to read the files in a similar way but also use a BufReader in the middle of it. I'm not sure if it can make that of a difference but that seems like the only difference considering the rest of the parsing looks similar with iter/map stuff.

  134. AdventOfCode2021FSharp

    Solutions for Advent of Code 2021 in F#

    F# with Jupyter Notebook. Slow but works. I'll probably come back to this day and optimize the solution.

  135. advent-of-code-kotlin-2021

    Advent of Code 2021 Challenge (by PhenixFine)

    Kotlin - I didn't finish it until three in the morning and just now got around to cleaning up the code. I really struggled with part 2 ( path finding was one of my least favorite subject in computer science ). Though it probably wouldn't have taken so long if I had just scrapped part 2 when it became a mess, instead of wasting time trying to fix it.

  136. advent-of-code-2021

    Discontinued My solutions to https://adventofcode.com/2021 (by plan-x64)

  137. advent-of-code

    Attempt 1 (GitHub)

  138. adventofcode_2021

    My solutions for AoC21 in R and Julia

    That was the hardest so far for me. Pretty hacky and takes ~8s to finish. R / Rstats: Code

  139. Advent_of_Code

    My Advent of Code solutions. (by Farbfetzen)

    My solution in Python. A simple search without recursion.

  140. AoC2021_0

    Advent of Code 2021

    Used DFS part 1 part 2

  141. AdventOfCode2021

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

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

  • -πŸŽ„- 2021 Day 17 Solutions -πŸŽ„-

    99 projects | /r/adventofcode | 16 Dec 2021
  • -πŸŽ„- 2021 Day 13 Solutions -πŸŽ„-

    143 projects | /r/adventofcode | 12 Dec 2021
  • Real time in no time

    1 project | dev.to | 9 Dec 2024
  • Advent of Docker: Day 0

    1 project | dev.to | 2 Dec 2024
  • My December Adventure (of code)

    1 project | dev.to | 1 Dec 2024

Did you know that Python is
the 2nd most popular programming language
based on number of references?