Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hsaikia/Advent-of-Code
Solutions to Advent of Code problems
https://github.com/hsaikia/Advent-of-Code
Last synced: 3 months ago
JSON representation
Solutions to Advent of Code problems
- Host: GitHub
- URL: https://github.com/hsaikia/Advent-of-Code
- Owner: hsaikia
- License: mit
- Created: 2023-11-29T22:09:21.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-17T21:05:25.000Z (7 months ago)
- Last Synced: 2024-08-02T07:02:02.715Z (7 months ago)
- Language: Rust
- Size: 190 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Advent of Code
This repo contains my solutions to [Advent of Code](https://adventofcode.com/) problems in [Rust](https://www.rust-lang.org/). It also includes a helper library that I've developed over time, consisting of data structures and functions that have proven useful in solving past problems.
## How to run
You need to have rustc (and cargo) installed. Instructions [here](https://www.rust-lang.org/tools/install).
Then for any particular year_day we need to run this command from the root directory
```
cargo run --release --bin
```For example for binary `2022_01` say we have a `sample_input.txt` file in the root directory with the following contents
```
1000
2000
30004000
5000
60007000
8000
900010000
```Then we run
```
cargo run --release --bin 2022_01 sample_input.txt
```which outputs the answers for both parts
```
Part #1 Answer 24000
Time elapsed in Part #1 is: 75µsPart #2 Answer 41000
Time elapsed in Part #2 is: 5.042µs
```## Testing
Unit tests are included for some problems using the sample IO. To run tests
```
cargo test
```To test a specific binary only
```
cargo test --bin 2023_01
```## Documentation
To generate the docs for this package, run `cargo doc --open`