18
๐ - 2024 DAY 22 SOLUTIONS - ๐
(programming.dev)
An unofficial home for the advent of code community on programming.dev! Other challenges are also welcome!
Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
Everybody Codes is another collection of programming puzzles with seasonal events.
Solution Threads
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 |
Icon base by Lorc under CC BY 3.0 with modifications to add a gradient
console.log('Hello World')
Rust
Part 2 is crazy slow, but it works, so thats cool :D
~~Edit: Gonna fix this, because pt2 is stupid.~~
Much better, 2.4s. Still slow, but not 6 minutes slow.
Six minutes? ๐ I was feeling crappy about my 30 seconds (my naive big O cubed(?) logic means my code spends most of its time testing array equalities - 72 billion samples in the flamegraph!)
Most of my time is wasted on hashmap stuff. And the processing into the string, which really isnt needed anymore. :/
Have you tried gxhash or one of the other non-cryptographic hashers?
I probably should give that a try. Looks like it can just drop in, so might try it later. I see FxHash is pretty popular here as well.