Advent-of-Code-2021
My solution for the advent of code 2021, written in Rust
Error Handle
NOPE!!! unwrap()
everything everywhere
Use
To run all of the advent of code solutions
cargo run --release
To run only a specific day (replace {DAY_NUMBER} with the number of that day)
cargo run --release -- {DAY_NUMBER}
Performance
These timing was done on my shitty $5 VPS
Day - Name | Parse time | Part 1 | Part 2 | AoC link |
---|---|---|---|---|
01 - Sonar Sweep | 93us | 4us | 19us |
|
02 - Dive! | 79us | 8us | 8us |
|
03 - Binary Diagnostic | 131us | 86us | 61us |
|
04 - Giant Squid | 90us | 94us | 62us |
|
05 - Hydrothermal Venture | 126us | 1ms 560us | 2ms 72us |
|
06 - Lanternfish | 7us | 814ns | 1us 61ns |
|
07 - The Treachery of Whales | 51us | 450us | 5ms 594us |
|
08 - Seven Segment Search | 93us | 20us | 432us |
|
09 - Smoke Basin | 89us | 423us | 3ms 927us |
|
10 - Syntax Scoring | 41us | 96us | 96us |
|
11 - Dumbo Octopus | 1us 908ns | 1ms 474us | 6ms 766us |
|
12 - Passage Pathing | 11us | 2ms 822us | 125ms |
|
13 - Transparent Origami | 209us | 152us | 1ms 120us |
|
14 - Extended Polymerization | 8us | 35us | 164us |
|
15 - Chiton | 16us | 5ms 977us | 183ms |
|
16 - Packet Decoder | - | - | - |
|
17 - Trick Shot | 999ns | 100ns | 443us 027ns |
|
18 - Snailfish | 93us | 2ms 471us | 44ms 780us |
|
19 - Beacon Scanner | 21s 394ms | 82ns | 5us 190ns |
|
20 - Trench Map | 677us | 10ms 355us | 629ms |
|
21 - Dirac Dice | 302ns | 1us 194ns | 24ms 412us |
|
Note
- Day 15 part 2:
yep, 1 hour and 20 minutesWell, its execution time is now under 200 milliseconds... - Day 17 part 2: Brute forced it, computer's problems require programming solutions
- Day 19: I calculate the beacons and scanners location while parsing the input since it does not require the full input to be done, that's why the execution time are fast but the parsing is not
Dependencies
- humantime - to display the running time
- owo-colors - to print colored result in terminal