Commit graph

6 commits

Author SHA1 Message Date
ac6b97590c Solve 2025 day 4 pt 1-2
Had a bug in my aoc lib, that lost me an hour for pt 1:
The ADJ dict has SW twice, and lacks NE.

The bug is at least 2 years old. It was introduced in 661f18dca4
and apparently has never worked. I guess it has not been used
up until now.

That being said, it was straight-forward. A new helper for
grid was used the first time, as well as an improved vdbg()
function.
2025-12-10 00:34:12 +01:00
c3c2dd5759 Fix aoc lib bug
Lost 1h in 2025 day 4 pt 1 for this. :D

Apparently, ADJ is not used that often.
2025-12-10 00:34:12 +01:00
4a070e827b Solve 2025 day 3 pt 1-2
For the first part, I used itertools.combinations
to find the highest pairs of batteries. And as
expected, that solution did not scale well for pt 2.

I figured out that reducing batteries until the top
most 12 (and 2) remained was the correct way to go.

the _maxj(line, C) function is the hive conclusion
from the solution mega thread. I really liked this
brilliant use of a while loop to exlude batteries.

 - The first char just skip the while loop. A char
   emptying the battery list also does this.
2025-12-10 00:34:12 +01:00
4927b78e59 Solve 2025 day 2 pt 1-2
I tried to solve it without regexp at first, failed
brutally. Cut the line count by 80% using a regexp
instead.

It was also funny to get all square roots.
2025-12-10 00:34:12 +01:00
56ca9d19c4 Solve 2025 day 1 pt 1-2
Brute force, since I was to newly awake to figure out
the smart solution.
2025-12-10 00:34:12 +01:00
f0f78fa25c Initiate Advent of Code 2025 2025-12-10 00:34:12 +01:00