Advent-of-Code-2021
aoc2021
Our great sponsors
Advent-of-Code-2021 | aoc2021 | |
---|---|---|
14 | 32 | |
2 | 26 | |
- | - | |
4.3 | 0.0 | |
4 months ago | about 1 year ago | |
Python | Kotlin | |
- | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Advent-of-Code-2021
-
-🎄- 2022 Day 7 Solutions -🎄-
I totally recommend trying - it's going to be a lot of fun and you'll understand the structure better. I'm not a pro and I never studied CS - that's just my experience from last year (day 18).
-
[2021] What did you learn or take away from AoC 2021?
I keep a diary of what I learned, revised or improved at in my repo.
-
-🎄- 2021 Day 23 Solutions -🎄-
Python - needs over 45 seconds but WORKS, which is good enough for me after a couple of days, especially given the fact that I can spend at most 1-2 hours a day solving this... The ugliest part are probably the hard-coded distances from rooms to corridors and vice versa, but what the heck, it works.
-
-🎄- 2021 Day 18 Solutions -🎄-
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.
-
-🎄- 2021 Day 15 Solutions -🎄-
Python
-
-🎄- 2021 Day 14 Solutions -🎄-
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.
-
-🎄- 2021 Day 13 Solutions -🎄-
Python - two alternative solutions (lines 25-65 and 68-106, not including the parser)
-
-🎄- 2021 Day 10 Solutions -🎄-
Anyway, here's my stack-based Python solution. It could be made way shorter because there's actually no need to store data separately about valid lines (valid == not corrupt and empty stack), but I thought the verbose approach makes the solution a bit more understandable.
-
-🎄- 2021 Day 9 Solutions -🎄-
Figuring out that part 2 was essentially the 'find islands in a 2d matrix' problem was the easy thing. Remembering how to implement a DFS or BFS was another story. So I ended up implementing both for learning purposes (Python).
-
-🎄- 2021 Day 8 Solutions -🎄-
Here's my approach (I have no CS background) in Python. In short:
aoc2021
-
All years, all days, everything in Haskell
I've done every year in Haskell (2015 2016 2017 2018 2019 2020 2021), and so have several other people such as /u/glguy. I don't see if /u/mstksg has anything published for 2015 but they've done 2016 2017 2018 2019 2020 2021 along with some pretty good writeups, I recommend checking those out.
-
Jetbrains looks like it's about to release Compose ui for ios, and web!
I ran my own benchmarks for a whole ton of code at https://github.com/ephemient/aoc2021 on both Linux x64 and macos x64, and ended up disabling Kotlin/Native because it was varying between 10x and 100x slower than Kotlin/JVM, eventually timing out on CI. The generated code may be reasonable thanks to LLVM, but the runtime certainly is not.
-
-🎄- 2021 Day 25 Solutions -🎄-
Took a while for me to get around to completing this in Kotlin, Python, and Rust as well, since I was working on optimizing other solutions, but I finally made it.
-
-🎄- 2021 Day 24 Solutions -🎄-
So I switched tacks and implemented this in Kotlin, where mutation is easier. First version was brute-force with duplicate state avoidance (checked before the state explosion at every input), which worked quickly enough for part 1, but ran into OOMs for part 2. Once I replaced the HashSet with a custom LruSet (and later a simpler CacheSet which simply overwrites on hash collisions) it ran part 2 in a few minutes. I then ported this into Haskell.
-
-🎄- 2021 Day 23 Solutions -🎄-
Haskell 1171/339
-
-🎄- 2021 Day 22 Solutions -🎄-
Kotlin, Python, and Rust solutions are the same solution but much uglier.
-
-🎄- 2021 Day 21 Solutions -🎄-
I'm doing the same cached recursion in Kotlin, Python, and Rust.
-
-🎄- 2021 Day 20 Solutions -🎄-
Haskell 621/603
-
-🎄- 2021 Day 19 Solutions -🎄-
Haskell 258/240
-
-🎄- 2021 Day 18 Solutions -🎄-
Haskell Kotlin 622/1185
What are some alternatives?
adventofcode - Advent of Code solutions of 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 and 2023 in Scala
AoC - my personal repo for the advent of code yearly challenge
adventofcode - Advent of Code challenge solutions
roast - 🦋 Raku test suite
advent-2021 - [Moved to: https://github.com/Crazytieguy/advent-of-code]
advent-of-code-go - All 8 years of adventofcode.com solutions in Go/Golang; 2015 2016 2017 2018 2019 2020 2021 2022
adventofcode - Advent of code solutions
ghc - Mirror of the Glasgow Haskell Compiler. Please submit issues and patches to GHC's Gitlab instance (https://gitlab.haskell.org/ghc/ghc). First time contributors are encouraged to get started with the newcomers info (https://gitlab.haskell.org/ghc/ghc/wikis/contributing).
rockstar - The Rockstar programming language specification
adventofcode - Solutions for problems from AdventOfCode.com
aoc2021 - Advent of Code 2021 Solutions
Advent-of-Code - Advent of Code