mirror of
https://github.com/LeMoonStar/AoC24.git
synced 2025-07-07 21:49:59 +02:00
🎉 Initialized repository based on 2023 code
This commit is contained in:
commit
cc42c33b5d
65 changed files with 3897 additions and 0 deletions
32
src/days/d17.rs
Normal file
32
src/days/d17.rs
Normal file
|
@ -0,0 +1,32 @@
|
|||
use super::{Answer, Day, DayImpl};
|
||||
|
||||
const CURRENT_DAY: u8 = 17;
|
||||
|
||||
type Data = Vec<u64>;
|
||||
impl DayImpl<Data> for Day<CURRENT_DAY> {
|
||||
fn init_test() -> (Self, Data) {
|
||||
Self::init(include_str!("test_inputs/test17.txt"))
|
||||
}
|
||||
|
||||
fn expected_results() -> (Answer, Answer) {
|
||||
(Answer::Number(0), Answer::Number(0))
|
||||
}
|
||||
|
||||
fn init(input: &str) -> (Self, Data) {
|
||||
(
|
||||
Self {},
|
||||
input
|
||||
.lines()
|
||||
.map(|v| v.parse::<u64>().expect("error while parsing input."))
|
||||
.collect(),
|
||||
)
|
||||
}
|
||||
|
||||
fn one(&self, data: &mut Data) -> Answer {
|
||||
Answer::Number(data.len() as u64)
|
||||
}
|
||||
|
||||
fn two(&self, data: &mut Data) -> Answer {
|
||||
Answer::Number(data.len() as u64)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue