Mo :ferris: :tux: @ FOSDEM on Nostr: Part 2 was as easy as part 2 of day 9 😂 At least if you started with an efficient ...
Part 2 was as easy as part 2 of day 9 😂
At least if you started with an efficient solution in part 1.
Thinking about how to avoid allocations caused by inserting rows and columns made part 2 trivial. Just change a constant 🪄
Mean time (including parsing):
Part 1 and 2: 125µs
O(n^2) problem…
https://codeberg.org/mo8it/advent-of-code-2023/src/commit/7e697dca60f39a38291929913ed5887b71d9259a/day11/src
#AdventOfCode #AOC #AOC2023 #RustLang #Rust
At least if you started with an efficient solution in part 1.
Thinking about how to avoid allocations caused by inserting rows and columns made part 2 trivial. Just change a constant 🪄
Mean time (including parsing):
Part 1 and 2: 125µs
O(n^2) problem…
https://codeberg.org/mo8it/advent-of-code-2023/src/commit/7e697dca60f39a38291929913ed5887b71d9259a/day11/src
#AdventOfCode #AOC #AOC2023 #RustLang #Rust