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 19] Part 1: count correct for sample, too low for actual + no idea how to find out if orientation is correct
For reference, here's my work-in-progress code (Python). But most imporatntly I want to describe my line of thinking :
-
-π- 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 11] Flashing octopi
This is not my first visualisation but for the first time I decided to share one here. It looks worse on screen due to flickering (I print the board and clear the screen after each step). Here's the code.
-
-π- 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.
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?
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 of 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 and 2023 in Scala
aoc2021 - Advent of Code 2021 Solutions
AoC - my personal repo for the advent of code yearly challenge
amphibia - It's here! "What is it?" You may ask? It's Amphibiaβ’ of course! It's the Advent of Code 2021 Day 23 simulator you never asked for! Enjoy with a smile please!
adventofcode - Advent of Code challenge solutions
Advent-of-Code - Advent of Code
roast - π¦ Raku test suite
AdventOfCode2021
advent-2021 - [Moved to: https://github.com/Crazytieguy/advent-of-code]
adventofcode - Advent of code solutions