For this one part 1 was relatively simple (parsing was the longest task), despite my basic bruteforce solution still needing more than 2s to find an answer.
For part 2 I was initially excited to finally implement Gaussian elimination by myself, but then realized it couldn't work because this was a minimization problem. A quick search showed me that it was an integer linear programming problem, which everyone recommended to solve with a library.
Despite my better judgement, I convinced myself that a DFS exploration could maybe work. And it did! ... on the example.
So in the end I caved and did it with z3 like most people. At least it seems that the z3 crate has greatly improved in the past 2 years, and my code using it is relatively simple.
I also found this fun thing on the Z3 C documentation: https://social.treehouse.systems/@Aissen/115699422672481929
#AdventOfCode #RustLang #z3