@blinry and I are still trying to solve last year's #adventOfCode. We're stuck on day 10, and we're out of ideas – except using linear optimization algorithms, but that feels like overkill... Has anyone of you solved day 10 and has a tip for us – do we really need to implement linear optimization?
https://en.wikipedia.org/wiki/Linear_programming#Integer_unknowns

Please use a spoiler for your answers ^^'

#AOC25 #advent_of_code #adventofcode2025 #adventofcode2025day10

Linear programming - Wikipedia

@piko @blinry I haven’t found a great solution myself, but I have this link in my notes of someone who used some DFS thingy:

https://old.reddit.com/r/adventofcode/comments/1pity70/2025_day_10_solutions/ntb36sb/

I did not dig through this at all (it’s still on the “TODO later” list 😅), so I can’t vouch for it. Still, maybe you two can get some useful pointers here … ?

@piko @blinry You can see my scruffy handwritten notes on an approach here https://z80.timholyoake.uk/advent-of-code-2025-in-fortran-77-mostly/ along with a link to my repository with my final version in it. It's written in fixed width Fortran, but uses recursion, so is a bit of a hybrid between legacy and modern Fortran! It should be relatively readable though as the final code includes comments.
Advent of Code 2025 in Fortran 77 (mostly) – retrocomputing ephemera

Dynamic programming - Wikipedia

@piko @blinry I first solved part 2 with a recursive algorithm. After some optimisations it found the solution in 16min (Rust). Then I learned about Z3, which a lot of people used, which actually was quite interesting. This solution solves part 2 in less than a second, of course.

https://adventofcode.com/2025/day/10 , right?

I did not code a solution and only read what's on that page, didn't log in.

It does not matter in which order buttons are pressed.

It does not make sense to press the same button twice, as the second press only reverts what the first did.

Potential solution to the problem can be mapped to subsets of buttons.

Generate all subsets of buttons, ordered by number of elements in that subset.

@piko @blinry

Day 10 - Advent of Code 2025

By only reading what's available to the public without logging in, I'm probably missing relevant detail. If so, pardon the noise!

@piko @blinry