Running:
cargo run --release -- <day>
So, cargo run --release -- 7 will execute Parts 1 and 2 from Day 7
Testing:
cargo test --release
Debugging in VS Code:
- Install C/C++, CodeLLDB, and Rust (rls) Extensions.
- Set
// Day to debugarg in .vscode/launch.json - Press F5
| Day | Part 1 | Part 2 | Comments |
|---|---|---|---|
| 1 | ✔️ | ✔️ | |
| 2 | ✔️ | ✔️ | Brute forced Part 2 because of small range -- no inverse function |
| 3 | ✔️ | ✔️ | Cached str rep of points for first wire, did lookups of points in second wire for intersections |
| 4 | ✔️ | ✔️ | Decently optimized but could go further by restricting loop range by considering gap value and higher power digit values |
| 5 | ✔️ | ✔️ | |
| 6 | ✔️ | ✔️ | I fought the Borrow Checker, and the Borrow Checker (almost) won |
| 7 | ✔️ | ✔️ | |
| 8 | ✔️ | ✔️ | Was expecting "Be sure to drink your Ovaltine" |
| 9 | ✔️ | ✔️ | |
| 10 | ✔️ | ✔️ | |
| 11 | ✔️ | ✔️ | |
| 12 | ✔️ | ✔️ | Thanks, Euclid |
| 13 | ✔️ | ✔️ | Used an aimbot :) |
| 14 | ✔️ | ✔️ | |
| 15 | ✔️ | ✔️ | |
| 16 | ✔️ | ✔️ | |
| 17 | ✔️ | ✔️ | Solve by hand: 2 minutes. Solve programmatically: 2 hours |
| 18 | ✔️ | ✔️ | My brain hurts |
| 19 | ✔️ | ✔️ | |
| 20 | ✔️ | ✔️ | Enough with the BFS |
| 21 | ✔️ | ✔️ | Thanks, DeMorgan |
| 22 | ✔️ | ✔️ | https://i.redd.it/047ti52dd9641.jpg |
| 23 | ✔️ | ✔️ | |
| 24 | ✔️ | ✔️ | https://i.imgur.com/wUXpjIL.jpg |
| 25 | ✔️ | ✔️ | https://i.imgur.com/9eAuz44.jpg |
