2025-12-09 18:27:33
I had a busy and fun weekend. So I am catching up. Nothing to add here.
I just completed "Laboratories" - Day 7 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/7
I had a busy and fun weekend. So I am catching up. Nothing to add here.
I just completed "Laboratories" - Day 7 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/7
I just completed "Playground" - Day 8 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/8
I just completed "Laboratories" - Day 7 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/7
I just completed "Movie Theater" - Day 9 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/9
After writing some questionable `rust` code for #adventofcode Day 8, I've managed to get the right answers in a reasonable amount of time which has taken far, far longer than I'd care to admit. I'll jump on the Python and Nim solves later because my brain is absolutely fried at the moment.
Solution:
Now I finished #AdventOfCode Day 8 (I needed to remove some of my tangled-up data structures to get a clear view again...). Still not in the mood for Day 9 part 2.
While I did not even finish part 1 of day 8 of #AdventOfCode (it was a holiday in .at and I had some weird bug which I did not want to spend any more time on), day 9 part 1 was very easy. Part 2 probably needs some smart math, which I'm currently not inclined to think about.
I just completed "Laboratories" - Day 7 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/7
I just completed "Trash Compactor" - Day 6 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/6
Hrmm, worked on writing the #adventofcode 2025 Day 1 solve in Rust, wasn't too horrible. Pretty fast though I did have all of the tabs open trying to figure out how to do things.
#rust
I just completed "Cafeteria" - Day 5 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/5
Lots to cleanup still, but this one is done!
A quick comparison using `hyperfine` for some benchmarking on the #adventofcode 2025 Day 1 solution. Not too shabby for any of the solutions, and its interesting to compare them.
#rust #nim
A classic. I've implemented the sweep-merge-interval algorithm in more languages than I can remember. #Gleam
I just completed "Cafeteria" - Day 5 - Advent of Code 2025 #AdventOfCode
I'm doing Advent of Code in Typst this year. I forgot to do it when AoC started so I had to do day 1-4 all today.
The scripting language in Typst has a Python / JavaScript -like feel to it, with iterators that work a lot like in Rust.
#adventofcode
I just completed "Printing Department" - Day 4 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/4
And I'm caught up!
With being behind, I was in get it done mode…
I just completed "Cafeteria" - Day 5 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/5
Yes! Today's puzzle in #AdventOfCode was quite hard (especially part 2) but so rewarding and I learned a lot!
For part 1, I implemented A* from scratch, my favorite little pathfinding algo that I use pretty much every year for #AoC (sometimes I use a lib instead of implementing it but it's been a while so a refresher was in order).
For part 2, after trying A* again and noticing it was running for way too long, I went back to the drawing board and solved the first machine by hand. I noticed the constraints were a system of linear equations.
I then researched algorithms to solve such integer programming problems and didn't feel like learning AND implementing the algorithms in one day (ain't nobody got time fo that). But this lead me to discover the `good_lp` #rust crate which is really good and that I will keep in my back pocket from now on!
So I used the library to define a system of variables and constraints which could be solved magically for me.
#AoC2025 #AdventOfCode2025 #RustLang
I just completed "Trash Compactor" - Day 6 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/6
Weihnachtszeit (also #adventofcode
I just completed "Gift Shop" - Day 2 - Advent of Code 2025
There is a really nice one line trick for part 2. :)
#AdventOfCode https://adventofcode.com/2025/day/2
I just completed "Gift Shop" - Day 2 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/2
progress continues - goal today: complete Day 3 both parts and Day 4 part 1 🤞
Anybody out there thinking of doing #adventofcode in #cobol?
#AdventOfCode Day 6: Part 1 was easy, for part 2 it was obvious what to do (after I read the instructions a few times to figure out what is considered a cephalopod number), but it took me a while to properly rotate my arrays. At least I got to finally use `for my ($i, $val) (indexed @array) { .. }` (which I failed to use (properly) on day 3).
In Part 2 I did a REAL MESS. But surprisingly, it works in 10 milliseconds. Time to make this more presentable, I guess.
(I don't particularly like parse-based challenges)
I just completed "Trash Compactor" - Day 6 - Advent of Code 2025 #AdventOfCode
I just completed "Secret Entrance" - Day 1 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/1
Bad start to the week and month, but, famous last words, I'm gonna try to…
A nice bump in difficulty for today's #AdventOfCode problem!
Although the first part came to me very easily, I spent way too much time trying to implement a flooding algorithm for part 2, only to find out that it would take too much time and there should be a better way.
The worst part is that I had the intuition for my final solution super early on, but couldn't materialize it in a simple way until tonight.
I also must admit I realized quite late that the points were sorted in the input :D I should RTFM better sometimes.
My final #rust solution runs very quickly and is reasonably clean.
#AoC #AoC2025 #AdventOfCode2025 #RustLang
I just completed "Lobby" - Day 3 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/3
"If only we hadn't switched to the new inventory management system right before Christmas!" another Elf exclaims.
The elves discovered Project Management, apparently.
Happy #adventOfCode !
Grids are my bread and butter, but I am not confident in my handling of mutable grids on #Gleam. Luckily, I didn't need any.
I just completed "Printing Department" - Day 4 - Advent of Code 2025 #AdventOfCode
I just completed "Printing Department" - Day 4 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/4
#AdventOfCode Day 5: My stupid part 1 solution was too slow (because I checked each ingridient instead of compare the ranges). After fixing that it was fast and correct. I have a plan for part 2, but $job to do, so let's see when I get a round tuit (to quote an old #Perl saying).
I always love it when I make part 1 general enough that all I have to do for part 2 is change a parameter. #gleam
I just completed "Lobby" - Day 3 - Advent of Code 2025 #AdventOfCode
I just completed "Gift Shop" - Day 2 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/2
#AdventOfCode day 4 was quite easy (though my solution is not very performant (1sec))
I've completed "Secret Entrance" - Day 1 - Advent of Code 2025 #AdventOfCode
I am not sharing the solution because this year I am using #Gleam and I am far from efficient in it. Yet. :D
I just completed "Secret Entrance" - Day 1 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/1
Not a bad start, part 2 kinda kicked my ass because reading is really, really hard. I made the assumption that there wouldn't be any spins greater than 99 which was a horrible, horrible assumption to make.
However, not too difficult overall, happy enough with the solve.
#adventOfCode
#AdventOfCode Day 1 visualization with #Lua and #Love2D
For day 3 of #AdventOfCode I outsmarted myself by using `each` on an array to get the index and the value, but forgot that #Perl does not reset the counter when you exit the loop early. (It worked for part 1, though..). After switching to a stupid c-style for loop it was easy (because I agai…
A cool graph problem today in #AdventOfCode
Nothing special here, I leveraged the `petgraph` #rust crate which I love! Calculating all pairs' distances (squared) and joining the pairs that are closest with an edge.
Only thing I wish I had more time to implement would be the graph traversal algo during sub-net aggregation, but swamped with work at the moment.
#AoC #AoC2025 #AdventOfCode2025 #RustLang
I just completed "Gift Shop" - Day 2 - Advent of Code 2025 #AdventOfCode https://adventofcode.com/2025/day/2
For Day 2 of #AdventOfCode I did a stupid and slow solution for part 1 and an even slower and extremly stupid solution for part 2 (using autogenerated and some handcrafted(!) regex).
I swear I read Day 1's specs as 0..99 range.
For some reasons, I kept on working on part 1 solution as if it was 1..99. I was scratching my head for an embarrassingly long time.
Off-by-one won. again.
#adventOfCode
Today I did day 1 of #AdventOfCode, and obviously missed the small trap hidden in the second part. Solved the first part with math and the second part with ... let's say a simulation (which sounds smarter than brute force clicking through all positions because I'm to dumb to figure out my Lattenzaunproblem...)
So, 11 out of 12 days completed for #AdventofCode and my thoughts for this year:
- `nim` is probably the language I've enjoyed coding the most in.
- `python`'s whole ecosystem of libraries just makes things so much easier. Day 10 and `scipy` just destroyed that solution (part 2 specifically)
- `rust` annoys me, but I 100% admit that it's a skill issue on my pa…
December is just around the corner, 12 days of brilliantly fun #AdventOfCode puzzles
Have fun, folks 🥳
https://github.com/csessh/aoc.nvim
Today's puzzle in #AdventOfCode was another grid puzzle, where I again represented the entities as a sparse set.
Part 1 was relatively straightforward, a simplified BFS-like process allowed to construct the beams going through the system.
For part 2, additionally to gathering where a beam was present, I added metadata about how many paths were going through each position, adding them up and splitting them as required. Summing the paths for the last row gave the required result.
#AoC #AoC2025 #AdventOfCode2025 #RustLang #rust
This was fun. But I can clearly optimize the algorithm once I learn #Gleam better.
I just completed "Playground" - Day 8 - Advent of Code 2025 #AdventOfCode
Today's #AdventOfCode problem was more about parsing than about complex logic, but it was fun!
I opted to keep the parsing with winnow simple and do most of it by hand from the raw characters, to exercise my #rust iterators a bit.
#AoC #AoC2025 #AdventOfCode2025 #RustLang
Another easy challenge in today's #AdventOfCode puzzle.
Part 1 is straightforward, and for part 2, the trick was to sort the list of ID ranges first, which made the merging pretty easy.
#AoC #AoC2025 #AdventOfCode2025 #rust #RustLang
Today, instead of the last day of #AdventOfCode, I will finish our MAB2-to-MARC21 converter (handling depended works), which in fact feels quite similar to working on Advent of Code puzzles.
Didn't feel like thinking too much for today's problem of #AdventOfCode, so my solution is quite naive and runs in a few tens of milliseconds for part 2 (thanks, #RustLang!).
I went for a HashSet for the grid just because it made looking up neighbours simpler at the edges, probably also not the most performant solution, but gets better as the grid becomes sparser.
#AoC #AoC2025 #AdventOfCode2025 #rust
Super happy with my solution for today's #AdventOfCode problem!
It initially took me a little bit of time to find a suitable strategy, but it all clicked when I noticed that the left-most selected digit had the most significance in the final value. Thus, I maximized the value of that left-most digit, leaving enough digits on the right side to be able to pick the required total number of batteries in the bank.
The solution is relatively short and sweet:
#AdventOfCode2025 #AoC #AoC2025 #RustLang #rust
Today's #AdventOfCode problem was fun! I kept a different implementation for part 1 vs part 2 as they both run relatively fast.
For part 1, I iterated over all IDs (the ranges are quite small) and split them in half mathematically (no string representation) to compare both halves.
For part 2, I instead generated all interestings IDs (mathematically again) up to a length of 10 digits (the max in my input) and checked if any of the ranges contained them.
#AoC #AoC2025 #AdventOfCode2025 #RustLang #rust
Day 11 of #AdventOfCode is a classical graph problem like we're used to from previous years.
Unlike previously, I immediately thought of checking what the graph looked like with a visualization tool. Luckily, `petgraph` allows to export a graphviz file which can be then used to visualize the nodes and edges.
From that, it was clear that a few nodes were acting as "bridges" between largers subnets of nodes with no particular arrangement besides being directed towards the next "bridge" layer. Those bridge layers comprised 4 to 5 nodes in my input, and were the only ones with more than 6 incoming edges, so I used that as my filter criterion.
To gather them, I sorted the graph in topological order and chunked them by their position offset compared to the previous node. When doing this, all the nodes from a bridge layer end up being at most 20 positions away from the previous node in the sorted list.
Finally, I progressed through each subnet, collecting information about how many paths lead to each one of the end layer's nodes. By multiplying with all the paths leading to each start layer's node, we get the overall total number of paths.
#AoC #AoC2025 #AdventOfCode2025 #RustLang #rust
For the last day of #AdventOfCode, I took a very simple and naive approach of: depth-first search.
Basically try all combinations until one fits. The trick to avoid a VERY long runtime is to filter out all cases where we already know from the start that the pieces (gifts) won't fit in the region, because their summed area exceeds the area of the region. Went for recursion this time around, because why not.
#AoC #AoC205 #AdventOfCode2025 #RustLang #rust