I've been enjoying Go this year and thought I might learn more by doing AoC with it too.
The Chief Historian is always present for the big Christmas sleigh launch, but nobody has seen him in months! Last anyone heard, he was visiting locations that are historically significant to the North Pole; a group of Senior Historians has asked you to accompany them as they check the places they think he was most likely to visit.
As each location is checked, they will mark it on their list with a star. They figure the Chief Historian must be in one of the first fifty places they'll look, so in order to save Christmas, you need to help them get fifty stars on their list before Santa takes off on December 25th.
Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!
Day | #1 | #1 Answer | #2 | #2 Answer |
---|---|---|---|---|
Day 1: Historian Hysteria | 🌟 | 1666427 | 🌟 | 24316233 |
Day 2: Red-Nosed Reports | 🌟 | 564 | 🌟 | 604 |
Day 3: Mull It Over | 🌟 | 161085926 | 🌟 | 82045421 |
Day 4: Ceres Search | 🌟 | 2562 | 🌟 | 1902 |
Day 5: Print Queue | 🌟 | 3608 | 🌟 | 4922 |
Day 6: Guard Gallivant | 🌟 | 4778 | 🌟 | 1618 |
Day 7: Bridge Repair | 🌟 | 1399219271639 | 🌟 | 275791737999003 |
Day 8: Resonant Collinearity | 🌟 | 220 | 🌟 | 813 |
Day 9: Disk Fragmenter | 🌟 | 6384282079460 | 🌟 | 6408966547049 |
Day 10: Hoof It | 🌟 | 652 | 🌟 | 1432 |
Day 11: Plutonian Pebbles | 🌟 | 187738 | 🌟 | 223767210249237 |
Day 12: Garden Groups | 🌟 | 1522850 | 🌟 | 953738 |
Day 13: Claw Contraption | 🌟 | 26299 | 🌟 | 107824497933339 |
Day 14: Restroom Redoubt | 🌟 | 228690000 | 🌟 | 7093 |
Day 15: Warehouse Woes | 🌟 | 1526018 | 🌟 | 1550677 |
Day 16: Reindeer Maze | 🌟 | 78428 | 🌟 | 463 |
Day 17: Chronospatial Computer | 🌟 | 2,0,1,3,4,0,2,1,7 | 🌟 | 236580836040301 |
Day 18: RAM Run | 🌟 | 288 | 🌟 | 52,5 |
Day 19: Linen Layout | 🌟 | 209 | 🌟 | 777669668613191 |
Day 20: Race Condition | 🌟 | 1351 | 🌟 | 966130 |
Day 21: Keypad Conundrum | 🌟 | 217662 | 🌟 | 263617786809000 |
Day 22: Monkey Market | 🌟 | 20068964552 | 🌟 | 2246 |
Day 23: LAN Party | 🌟 | 926 | 🌟 | az,ed,hz,it,ld,nh,pc,td,ty,ux,wc,yg,zz |
Day 24: Crossed Wires | 🌟 | 53325321422566 | ||
Day 25: Code Chronicle | 🌟 | 2900 |
Using Go's built-in benchmarking with the testing package. Computer is a 2021 MacBook Pro M1 Pro, 32 GB RAM.
Day | #1 | #2 | Improvement* |
---|---|---|---|
1 | 116264 ns/op | 131233 ns/op | 3.53% / 68.43% |
2 | 310935 ns/op | 723512 ns/op | |
3 | 336448 ns/op | 785320 ns/op | - / 36.98% |
4 | 250981 ns/op | 110358 ns/op | 91.24% / 62.52% |
5 | 778880 ns/op | 3129873 ns/op | 53.34% / 81.91% |
6 | 312461 ns/op | 1153391125 ns/op | |
7 | 16480300 ns/op | 842853000 ns/op | 87.01% / 91.67% |
8 | 58749 ns/op | 121247 ns/op | |
9 | 381476181 ns/op | 171042257 ns/op | |
10 | 1424599 ns/op | 1789071 ns/op | 64.68% / 64.01% |
11 | 424021 ns/op | 15488584 ns/op | |
12 | 6677348 ns/op | 12339733 ns/op | 39.21% / 26.80% |
13 | 698173 ns/op | 702380 ns/op | 75.93% / - |
14 | 55522 ns/op | 56488050 ns/op | 90.67% / - |
15 | 477450 ns/op | 3498110 ns/op | |
16 | 97868160 ns/op | 99166694 ns/op | |
17 | 13964 ns/op | 561424 ns/op | |
18 | 755414 ns/op | 1996995 ns/op | |
19 | 16126963 ns/op | 16206756 ns/op | |
20 | 106801508 ns/op | 306290916 ns/op | 85.99% / 63.78% |
21 | 16344 ns/op | 16282 ns/op | |
22 | 36743155 ns/op | 617890208 ns/op | |
23 | 14217211 ns/op | 14168757 ns/op | |
24 | 434869 ns/op | ||
25 | 547803 ns/op |
* compared to first solution
Day | #1 | #2 | Improvement | Link |
---|---|---|---|---|
1 | 120513 ns/op | 415683 ns/op | Baseline | Link |
1 | 120513 ns/op | 155479 ns/op | - / 62,59% |
Link |
3 | 336448 ns/op | 1246155 ns/op | Baseline | Link |
4 | 2864606 ns/op | 294413 ns/op | Baseline | Link |
4 | 523315 ns/op | 217584 ns/op | 81.73% / 26.09% |
Link |
5 | 1669175 ns/op | 17299190 ns/op | Baseline | Link |
7 | 126892714 ns/op | 10124683583 ns/op | Baseline | Link |
7 | 110164692 ns/op | 7135839625 ns/op | 13.18% / 29.52% |
Link |
10 | 1424599 ns/op | 1789071 ns/op | Baseline | Link |
12 | 10984420 ns/op | 16856988 ns/op | Baseline | Link |
13 | 2900453 ns/op | 702380 ns/op | Baseline | Link |
14 | 594981 ns/op | 56488050 ns/op | Baseline | Link |
20 | 762519479 ns/op | 845552729 ns/op | Baseline | Link |
Run a day
make run day=<number>
Run test for a day
make test day=<number>
Create a new day
make create-day day=<number>