silmeth 🇺🇦 on Nostr: npub129gva…e4kwg I did part 2 the “correct” way because I’m impatient. So I ...
npub129gvast08lj986yftn7q5qlnj8yfqufxx0m33s9u5xssjm8c64rsve4kwg (npub129g…4kwg) I did part 2 the “correct” way because I’m impatient. So I got tired of waiting for the brute force solution to finish after about ~30 seconds.
So instead of waiting 3 minutes for the result I spent 2 hours chasing weird range-operation bugs.
Mine finishes in ~37 µs on my PC (on top of input parsing which is another 43 ± 3 µs).
I do allocate a new vector for resulting ranges for every input range though.
https://gitlab.com/silmeth/advent-of-code-2023/-/blob/main/day-05/src/lib.rs#L163-200
So instead of waiting 3 minutes for the result I spent 2 hours chasing weird range-operation bugs.
Mine finishes in ~37 µs on my PC (on top of input parsing which is another 43 ± 3 µs).
I do allocate a new vector for resulting ranges for every input range though.
https://gitlab.com/silmeth/advent-of-code-2023/-/blob/main/day-05/src/lib.rs#L163-200