Home

Awesome

Advent of Code

<p align="left"> <a href="https://github.com/AndrejOrsula/aoc/actions/workflows/rust.yml"> <img alt="Rust" src="https://github.com/AndrejOrsula/aoc/actions/workflows/rust.yml/badge.svg"></a> <a href="https://github.com/AndrejOrsula/aoc/actions/workflows/docker.yml"> <img alt="Docker" src="https://github.com/AndrejOrsula/aoc/actions/workflows/docker.yml/badge.svg"></a> <a href="https://deps.rs/repo/github/AndrejOrsula/aoc"> <img alt="deps.rs" src="https://deps.rs/repo/github/AndrejOrsula/aoc/status.svg"></a> <a href="https://codecov.io/gh/AndrejOrsula/aoc"> <img alt="codecov.io" src="https://codecov.io/gh/AndrejOrsula/aoc/branch/main/graph/badge.svg"></a> </p>

My solutions to Advent of Code puzzles.

Edition

Advent of Code 2023

All benchmarks are run on a Dell Precision 5550 laptop with an Intel Core i7-10875H CPU.

<table> <tr><th>Day</th><th>Part 1 Performance</th><th>Part 2 Performance</th></tr> <tr><td>
DPuzzleCode
1Trebuchet?!day1.rs
2Cube Conundrumday2.rs
3Gear Ratiosday3.rs
4Scratchcardsday4.rs
5If You Give A Seed ...day5.rs
6Wait For Itday6.rs
7Camel Cardsday7.rs
8Haunted Wastelandday8.rs
9Mirage Maintenanceday9.rs
10Pipe Mazeday10.rs
11Cosmic Expansionday11.rs
12Hot Springsday12.rs
13Point of Incidenceday13.rs
14Parabolic Reflector ...day14.rs
15Lens Libraryday15.rs
16The Floor Will Be ...day16.rs
17Clumsy Crucibleday17.rs
18Lavaduct Lagoonday18.rs
19Aplentyday19.rs
20Pulse Propagationday20.rs
21Step Counterday21.rs
22Sand Slabsday22.rs
23A Long Walkday23.rs
24Never Tell Me The ...day24.rs
25Snowverloadday25.rs
</td><td>
GeneratorRunner
4.408 µs80.30 µs
112.7 µs1.056 µs
5.884 µs508.0 µs
92.21 µs27.78 µs
21.77 µs5.197 µs
16.90 µs0.248 µs
170.1 µs76.89 µs
181.6 µs323.7 µs
165.9 µs38.10 µs
159.7 µs183.6 µs
7.197 ms1.085 ms
276.1 µs477.4 µs
58.49 µs359.9 µs
87.00 µs61.28 µs
195.8 µs24.98 µs
33.91 µs622.1 µs
50.64 µs78.82 ms
30.70 µs1.981 µs
228.0 µs31.74 µs
33.73 µs4.654 ms
498.8 µs6.057 ms
254.8 µs41.48 ms
101.8 µs2.554 ms
100.3 µs1.486 ms
320.8 µs245.7 ms
</td><td>
GeneratorRunner
0.558 µs930.2 µs
126.6 µs1.347 µs
0.462 µs437.1 µs
113.4 µs27.97 µs
17.87 µs108.7 µs
0.666 µs0.659 µs
177.0 µs66.30 µs
153.8 µs1.069 ms
119.2 µs45.94 µs
163.3 µs222.8 µs
7.172 ms1.080 ms
247.1 µs8.984 ms
10.10 µs192.8 µs
72.12 µs38.33 ms
161.4 µs128.9 µs
32.84 µs20.16 ms
29.74 µs289.0 ms
43.98 µs1.778 µs
213.9 µs69.56 µs
32.87 µs21.57 ms
491.3 µs86.90 ms
252.4 µs61.18 ms
101.2 µs2.5839 s
79.73 µs2.4001 s
0.000 µs0.000 µs
</td></tr> </table>

Instructions

<a href="#-rust"><img src="https://rustacean.net/assets/rustacean-flat-noshadow.svg" width="16" height="16"></a> Rust

<a href="#-test-the-correctness-of-solutions"><img src="https://www.svgrepo.com/show/271355/rocket-ship-rocket.svg" width="14" height="14"></a> Get Answers and Run Performance Benchmarks

Thanks to cargo-aoc, answers and performance benchmarks for all days are obtainable by running the main binary.

cargo run --release

<a href="#-test-the-correctness-of-solutions"><img src="https://www.svgrepo.com/show/269868/lab.svg" width="14" height="14"></a> Test the Correctness of Solutions

All days also include tests using sample inputs from the puzzle descriptions.

cargo test

License

This project is dual-licensed to be compatible with the Rust project, under either the MIT or Apache 2.0 licenses.