Contains my solutions to the AdventOfCode 2024 puzzles, using Rust.
To know what AdventOfCode is, check the official website.
These by no means are the best solutions to the puzzles, but they are the ones I came up with. The exercise is meant to learn rust. This repository also contains the test data for my user, which you should change for your user if you're following along. Every exercise requires a
testfile
, which is the input data for the exercise, simply modify create a file in the exercise directory and add test data to it.
To run the solutions, use the following command:
cargo run 1_1
This will run the solution for the first exercise of the first day. The solution will be printed to the console. To run any other exercise, simply change the argument to the command, for example if you want to run the solution for day 2, problem 1
cargo run 2_1
These are my solutions, with runtimes! 😎
Day | Title | 1 🏃♂️ | 2 🏃♂️ | Part 1 | Part 2 |
---|---|---|---|---|---|
01 | Historian Hysteria | 373µs | 393µs | Exercise1_1.rs | Exercise1_2.rs |
02 | Red-Nosed Reports | 521µs | 1.5ms | Exercise2_1.rs | Exercise2_2.rs |
03 | Mull it Over | 506µs | 560µs | Exercise3_1.rs | Exercise3_2.rs |
04 | Ceres Search | 3.7ms | 657µs | Exercise4_1.rs | Exercise4_2.rs |
05 | Print Queue | 511µs | 795µs | Exercise5_1.rs | Exercise5_2.rs |
06 | Guard Gallivant | 313µs | 740µs | Exercise6_1.rs | Exercise6_2.rs |
07 | Bridge Repair | 1.80ms | 19.3ms | Exercise7_1.rs | Exercise7_2.rs |
08 | Resonant Collinearity | 781µs | 996µs | Exercise8_1.rs | Exercise8_2.rs |
09 | Disk Fragmenter | 1.73ms | 90.8ms | Exercise9_1.rs | Exercise9_2.rs |
10 | Hoof It | 998µs | 868µs | Exercise10_1.rs | Exercise10_2.rs |
11 | Plutonian Pebbles | 916µs | 18.1ms | Exercise11_1.rs | Exercise11_2.rs |
12 | Garden Groups | 6.08ms | NA | Exercise12_1.rs | Exercise12_2.rs |
13 | Claw Contraption | 60µs | 62µs | Exercise13_1.rs | Exercise13_2.rs |
14 | Restroom Redoubt | 725µs | manual | Exercise14_1.rs | Exercise14_2.rs |
15 | Restroom Redoubt | 4ms | 5ms | Exercise15_1.rs | Exercise15_2.rs |
16 | Reindeer Maze | 9ms | 15s | Exercise16_1.rs | Exercise16_2.rs |
17 | Chronospatial Computer | 158µs | 3min | Exercise17_1.rs | Exercise17_2.rs |
18 | RAM Run | 1.5ms | 688ms | Exercise18_1.rs | Exercise18_2.rs |
19 | Linen Layout | 2.1ms | 13ms | Exercise19_1.rs | Exercise19_2.rs |
20 | Race Condition | 441ms | 588ms | Exercise20_1.rs | Exercise20_2.rs |
- Day 13, linear equation solving, though unsure why the results are in floating points when done on paper, when for sample case the integer values satify the equation. Need to read up on this.