From 1e75b2f345f38ee2a02da34eac0caebd00f97303 Mon Sep 17 00:00:00 2001 From: JamesPatrickGill Date: Tue, 3 Dec 2024 20:28:38 +0000 Subject: [PATCH] day 3 --- .gitignore | 2 -- data/examples/01.txt | 6 ++++++ data/examples/02.txt | 6 ++++++ data/examples/03.txt | 1 + src/bin/03.rs | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 data/examples/01.txt create mode 100644 data/examples/02.txt create mode 100644 data/examples/03.txt diff --git a/.gitignore b/.gitignore index eb7e945..216820d 100644 --- a/.gitignore +++ b/.gitignore @@ -17,8 +17,6 @@ target/ # Advent of Code # @see https://old.reddit.com/r/adventofcode/comments/k99rod/sharing_input_data_were_we_requested_not_to/gf2ukkf/?context=3 -data/examples/* -!data/examples/.keep data/inputs/* !data/inputs/.keep data/puzzles/* diff --git a/data/examples/01.txt b/data/examples/01.txt new file mode 100644 index 0000000..b8af9ad --- /dev/null +++ b/data/examples/01.txt @@ -0,0 +1,6 @@ +3 4 +4 3 +2 5 +1 3 +3 9 +3 3 diff --git a/data/examples/02.txt b/data/examples/02.txt new file mode 100644 index 0000000..b49c10d --- /dev/null +++ b/data/examples/02.txt @@ -0,0 +1,6 @@ +7 6 4 2 1 +1 2 7 8 9 +9 7 6 2 1 +1 3 2 4 5 +8 6 4 4 1 +1 3 6 7 9 diff --git a/data/examples/03.txt b/data/examples/03.txt new file mode 100644 index 0000000..f274bda --- /dev/null +++ b/data/examples/03.txt @@ -0,0 +1 @@ +xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5)) diff --git a/src/bin/03.rs b/src/bin/03.rs index 6b68534..8c2dc92 100644 --- a/src/bin/03.rs +++ b/src/bin/03.rs @@ -62,6 +62,6 @@ mod tests { #[test] fn test_part_two() { let result = part_two(&advent_of_code::template::read_file("examples", DAY)); - assert_eq!(result, None); + assert_eq!(result, Some(161)); } }