diff --git a/src/year_2023/day_10_pipe_maze/mod.rs b/src/year_2023/day_10_pipe_maze/mod.rs new file mode 100644 index 0000000..f70aabe --- /dev/null +++ b/src/year_2023/day_10_pipe_maze/mod.rs @@ -0,0 +1,25 @@ +pub mod part_one; +//pub mod part_two; +//pub mod common; + +use crate::utils::solution::Solution; +use crate::utils::input_reader; + +pub struct DaySolution ; + + +impl Solution for DaySolution { + + fn input_path(&self) -> &'static str { + "input/2023/day_10/input.txt" + } + + fn part_one(&self) -> String { + input_reader::read_input_file(self.input_path(), part_one::part_one) + } + + fn part_two(&self) -> String { + //input_reader::read_input_file(self.input_path, part_two::part_two) + String::from("Not implemented") + } +} diff --git a/src/year_2023/day_10_pipe_maze/part_one.rs b/src/year_2023/day_10_pipe_maze/part_one.rs new file mode 100644 index 0000000..f6f005b --- /dev/null +++ b/src/year_2023/day_10_pipe_maze/part_one.rs @@ -0,0 +1,7 @@ +pub fn part_one(input_lines: Vec) -> String { + input_lines + .iter() + .map(|line| line.parse::().unwrap()) + .sum::() + .to_string() +} \ No newline at end of file