Electromagnetic Moat — Rust — #adventofcode Day 24
Today’s challenge, the penultimate, requires us to build a bridge capable of reaching across to the CPU, our final destination.
!!! commentary
We have a finite number of components that fit together in a restricted way from which to build a bridge, and we have to work out both the strongest and the longest bridge we can build. The most obvious way to do this is to recursively build every possible bridge and select the best, but that’s an O(n!) algorithm that could blow up quickly, so might as well go with a nice fast language! Might have to try this in Haskell too, because it’s the type of algorithm that lends itself naturally to a pure functional approach.