View Kaizen LeaderBoard.
This project uses cargo-aoc
to simplify the interactions with the server.
cargo install cargo-aoc
cargo aoc
Replace all textual occurences by the digits, but be careful to keep first and last letter to ensure overlapping digits are found.
Don't try to be smart and simply split and brute-parse the input. Use custom types Draw
and Game
to clean up the inner loops.
Use toodee
and some very ugly matrix traversal.
Don't try to be smart and simply split and brute-parse the input. Use custom types Numbers
and Card
to simplify inner loops, as always.
Use a sparse Range representation to avoid storing too many numbers.
For part 2, some memoisation could help accelerate the computations.
We know the second part usually uses much bigger numbers than the first one. Directly use algebra instead of brute force :)
Quick and dirty, but broke part1 to be able to pass part2.
- Part1 : Brute force, simply follow the network
- Part2 : Might need cycle detection or smarter things... Find least common multiple of all cycles: 20685524831999
Simple recursion
- Part1: Encode each pattern as vectors of integers for lines and columns, to "easily" compute the reflexion
- Part2: Looks like we have to use a greedy algorithm and change all mirrors :(
- Part1: Very simple hash algorithm, and use
map
/fold
/sum
. - Part2: Reinvent the ordered-hashmap