diff --git a/advent_of_code_2025/src/day4/input.txt b/advent_of_code_2025/src/day4/input.txt new file mode 100644 index 0000000..8873b54 --- /dev/null +++ b/advent_of_code_2025/src/day4/input.txt @@ -0,0 +1,140 @@ +@.@.@@@@@@@@.@.@@@@@@@@@@@@@.@@@@..@@@@.@@...@@@@.@@...@@@@.@@@.@@@@@@..@.@.@@@@.@..@@..@@.@.....@@@@..@@@@@@@@@@@.@@.@.@@@@.@..@@@@..@@@.@. +.@.@@.@@@..@@@.@@..@@@@@.@.@@@@@.@@.@@.@@..@...@@@@@@@...@@..@..@@@@@@.@@@@..@..@@@@@.@.@.@.@@@@.@.@.@.@@@@@@@@...@@..@.@.@@@@@...@@..@@@@@. +.@@.@@@.@.@.@@.@@@@@@@@@@..@..@@..@@..@.@@..@@.@@.@.@@.@..@@@@@.@@@@@@@..@@@.@.@..@.@@@@@@@..@@..@@.@.@.@@.....@@@..@@.@..@@.@...@@@..@.@@@@ +....@@@@@@..@@@..@@@@@.@.@.@.@@@@@@..@.@@@.@....@.@@@@@.@@.@@@@@@.@@@@@@.@@..@@@@...@@@@@@@@@@..@@.@@.@...@.@.@@@@.@.@@@@.@.@@.@@.@..@.@...@ +@@.@@.@..@@@......@@.@.@@.@@.@.@..@..@@@..@..@@@@@@..@@.@@@@@@@.@.@@@..@.@.@.@.@@@@.@@...@.@@@..@@@@..@@@@@@@@@@@.@@.@@@@@@@.@@@@@..@..@..@@ +@@@@@@@.@.@.@@@@@.@@@@@@@@@.@@@@@@..@@@@@@...@.@..@.@.@@@@@@@..@.@@@@@@@.@@@@@.@@@.@...@@.@..@@@@.@@@@@@..@@@@@.@@@.@....@@..@.@.@@@@@@@...@ +@@.@@@@.@.@@@.@@@..@@@@@.@@@@@@@@@@.@@@@.@.@@@@@@@.@....@@@.@.@@@@.@....@@..@@@@@..@@@@..@@....@@@@.@@@..@@@@@@.@..@@.@@@@.@@@@..@@@@.@@@..@ +..@@..@@@.@@..@@.@@@.@..@@@.@.@@@..@@@@@@.@.@@@@.@.@@..@@..@.@.@@@@........@@@@.@@@.@@.@@@@@.@@@.@@..@.@@.@.@@@.@@@@@.@@@.@..@@@@..@.@@.@@.@ +@@.@@...@..@@@@@.@@@@.@@@.@@..@.@...@@..@@@@@..@.@@@@@@@..@@@@.@@@@@.@.@@@.@@@....@.@@@.@.@.......@@.@@@..@..@@@@@@@...@..@@.@@@@@.@@@@@..@. +...@@@@.@...@@.@.@..@@.@@@..@@.@@@..@...@@@.@..@@@@@..@@.@@..@@...@@.@..@@.@@@@@@@@.@.@.@@@@@@@@@.@...@..@@@@..@@.@..@.@@@@@@..@@.@@@@..@..@ +@.@.@@@@.@.@.@.@@..@.@@@.@@@...@.@.@.@@.@@@@@@......@@.@@.@@@@@.@@.@@@@....@...@@@@.@@@@...@.@@.@.@@@@.@@@@.@....@@@.@@@@@@@@@@.@@@@.@@@@@.. +@.@@@@@.@.@..@@..@...@@@.@..@.@@@@@@.@@@@@.@@.@.@.@@...@@@.@@.@.@@@...@.@.@..@.@@..@@...@@@.@.@..@@@@.@@@@..@@@@@.@.@..@..@.@.@@.@....@....@ +@@@@@@@@@.@.@.....@@....@@@.@@.@@@@@.@@.@.@@@@@..@..@@.@...@.@.@@@.@.@@@@@@..@@.@@....@..@@.@.@@@@.@@.@..@.@@@@.@@.@@@..@@.@@...@@..@@.@@.@. +.@@@..@..@@.@@@.@@@@.@@@.@..@@.@@@..@@@@.@@@@.@.@@@@@@@@@.@.@@@@.@@@.....@@@@@.@@@@@@@@@@@..@@..@.@@@@...@@@@.@@@@@@@...@@@@@@@@@@@.@@@....@ +@@@@@..@@..@@.@@@@.@.@@@@@.@@.@@.@..@...@@@.@@.@@@@@@.@.@@@..@@@@@@@@@@.@@.@..@.@@@..@.@.@.@...@@@@@..@@@.@@@.@@@....@@.@.@..@@.@@.@@.@@..@. +@@@@@@@@.@@@@.@@@..@..@.@@..@@.@..@@@.@.@@...@@@@@.@@@..@@@@@@@@..@@@@...@.@..@.@@@@@@..@.@....@..@@@@.@@@@@@.@@@....@@.@@@@.@@@@@..@@.@..@. +@@@@.@@@.@@..@..@@@..@@@@@@@@@@@..@.@@@..@@@@..@@@@@@@@@@@@@@..@@@..@@@@@@@@@.@..@...@@@.@@.@.@......@@.@..@@@.@...@.@.@@@.@@@@...@@.@.@..@@ +@@.@.@@@@@@@@.@@@..@.....@..@.@@.@@@@....@@@...@@@@@@@@@....@.@@@@..@@.@@@@@.@.@@.@@.@.@@@@@@@@@@@.@.@.@@.@@@@..@.@.@.@@@.@@@.@@.@@...@.@@@. +@..@@.@@.@@@..@@.@@@@@@.@.@@.@.@.....@..@..@@.@@.@@@@@@@@..@@.@@@@@@@.@@@@...@@@.@@..@@..@..@@@.@.....@.@@.@@@@@...@@.@@@.@@@.@@@.@@..@.@.@@ +@@@@.@@@@@.@.@@.@...@.@@.@@@@@@@@@.@@@@@@.@@..@@@.@@@..@@.@.@@.@@@@@@.@@@.@..@@.@@.@@..@.@.@@@.@@@@@.@@.@...@@@.@@.@@@@@.@@..@@@@..@.@@@.@@@ +.@@@@.@....@..@@@@@@.@@@.@@@.@@@@@.@..@@@@@...@@@@.@@.@@@@@@@@.@@@@.@@@.@@..@...@@..@@.@...@@@.@@@@@@...@.@@@@@@@@@..@@.@@@.@@@.@.@@@.@..@@@ +@@@..@@@@.@@..@@@@..@@@.@..@....@@.@..@@.@..@@@@....@@.@.@.@.@@.@@@@@@@..@@@.@@@@..@@...@@.@@@.@@@@@....@@@@.@@..@@@.@@.@@..@@.@@.@...@@@..@ +@@@@@.@@@...@.@@..@.@@.@@..@..@.@.@@..@.....@@@@..@.@@@@.@@.@@@@@@@@@.@@..@@@@@@..@@..@..@.@@@@@@..@..@....@@@@@.@@@@@@..@@@@@@@@.@@..@@.@.. +.@...@@@@@@.@@@.@@@.@@@.@.@@@.@@@@@@@....@@@@@@.@..@@@.@@@@.@@@.@..@@@@.@@@..@.@.@@@@..@.@.@@...@@@.@.@@@.@.@@@@@@@.@@..@@.@.@.@.@.@@@@.@@@@ +@@@.@@.@@@@@@.@@@@@..@@@.@.@..@.@@@@.@.....@@@.@......@@@.@...@@@..@@@..@@.@...@.@@@@.@.@@.@@@@@@@@.@@.@@@.@.@...@@@@..@.@.@.@@@..@@@@@@.@@@ +@..@@.@@@@@@@@@@.@@..@.@.@@@@...@@..@..@@.@@@@.@.@....@.@@.@@@.@.@@.@.@.@@.@@@@@@@@@@@...@@@.@..@@.@.@@@@@@@@@@.@@.@.@@@.@@.@@@.@.@@@...@.@. +@@@@@@.@@@..@.@@@@@@.@@.@.@@@..@@@@@@@@.@.@@@@.@@@@@@@.@@@.@@@@@@..@@@@.@.@@@@@..@@@@@@@@@@.@.@@.@...@@.@@...@@@@.@@.@.@.@@@@@.@@@.@....@@@@ +.@@@@@@...@@.@.@@@.@@@..@.@@@@@@@@..@.@@@@@@@@....@@@@@@@.@@.@@@@@@@..@@....@@@@@@@...@..@.@...@@.@@@.@@@@.@.@@@.@.@@@@@@@.@@@@@@@@@@@.@@@@@ +@..@@@@.@@@@@.....@@.@@.@@@@@@.@..@.@@.@@.@@@@@.@@@@@@@...@.@.@........@..@@..@.@@@.@.@@.@@@.@@@.@.@.@@@.@..@@@@@..@@..@@.@.@@..@.@@.@@@.@@@ +...@.@@@.@@.@.@....@@@@@..@..@@@..@@@@@..@..@@@.@...@.@@.@@.@.@@..@.@@@...@.@@@@...@.@..@@.@@.@@@.@..@@.@@.@@.@@..@@.@.@.@.@.@@@@@@@@@...@@. +...@.@.@.@.@..@@@..@.@@...@@@@@@@@@@.@..@..@.@@.@.@@@@.@@@@@..@.@.@@@...@@..@@@@......@@@.@@@@.@@.@@...@@@@@@@@@@@@@@.@.@@.@@@@.@@..@.....@@ +@.@.@.@@@...@@.@@@@@....@@.@.@.@@.@@@@.@@@@..@@.@@@@.@@.@@@@@.@@@.@@@@@@.@@@.@@.@.@...@.@.@.@@@.@@..@@@.@@..@@@.@@@..@..@@@@..@@.@..@.@@@@@. +@@.@@@...@@..@..@@@.@@@@.@@@@.@@@.@@@@..@@@@@@@@...@@..@@@@..@.@@.@@@@@@...@@@@@@@..@.@@.@@@...@@.@@...@@@@@.@..@@@.@@@.@@@@.@@@@..@.@@@@.@. +@..@@@@.@@.@@@@.@@@.@.@@@.@@@.@@@@..@@.@@..@@@.@....@.@.@@@@.@@@.@.@.@@.@@..@.@@.@@@@@@@@...@@@@@..@@@.@@@@@@.@@@@@@.@@.@@@.@@..@@@@@@@@@.@. +@@@...@@@.@@@@@@.@.@@@@@..@.@@.@@.@@.@.@.@@@@@@.@..@@.@@@.@..@.@@@@@@@@@.@@@@@.@@@.@.@.@@.....@@@@.@...@@@@@.@@...@@@@@@@@@@@..@.@@@.@@.@@@. +@@@@@.@..@.@@@@@@...@@@@..@@@@@.@...@@@@@.@.@@.@@@..@@@@@@@.@@@...@@.@@@.@@@.@@@@@@@@@@..@@.@.@@@.@@@@.@@@.@@@.@..@@@.@@@.@@@..@@@@@.@@@..@@ +.@@@.@.@@@.@@.@@@@.@.@.@@.@@@@@@@@@@@.@@@@..@@.@@@@@@.@..@@@.@@@@@@@.@@.@...@@.@.@@@@@.@..@..@@@@..@..@@@@@@@@@..@.@@.@..@@..@@@..@@@.@@.@@. +@@@.@@..@@@@@.@@@.@@@....@@.@@@@.@..@@@..@@.@@@@@..@@@@@..@.@@@@.....@@@..@@@.@.@..@...@@@@@@@@..@@@.@.@@...@@.@...@@@@@@@@.@@@.@@@.@.@.@@@@ +@@.@@..@@@@.@..@.@@@@.@@@..@@.@..@.@@@@....@@@.@..@@@@...@.@@.@@@@@@@.@.@.@@@@@.@@@..@@...@@@@@...@@@@@@@.@.@@.@@@.@.@@.@@@@@@.@.@@.@.@.@@@@ +@.@@@.@@..@@..@@@@.@@.@@@@@@@@@@@.@.@@..@@@.@@..@@.@@@@.@..@@@@@...@@..@@.@.@.@.@@@@@@.@.@@........@@@.@@.@.@@@@.@.@...@@@@....@@.@@@@.@@.@@ +.@@.@..@.@@@@@@@.@.@@@@.@@@@@@.@@@@@.@@@@.@@@..@.@@@..@@@@.@@@@@.@.@.@@@@@.@@@@@..@@@@@@@@@.@@..@@@@.@@@@..@@.@@.@@@@@@...@@@@@.@...@@@@@@@. +@@.@.@@@.@..@.@@.@.@@..@.@.@@@@..@@.@@......@.@@.@@@@@@@@..@@@@.@.@.@@@@@.@@@.@@@.@@.@@@...@....@....@@@@@@....@.@@@@@.@@..@@...@@@@@@..@@.@ +@.@@.@@@@...@@@.@@.@.@.@@.@@.@@@@..@@@@.@@@.@@@@@@@@.@.@@@@@@@@@@@@@@.@.@@@.@@.@@.@@.@@@@@@@.@@@@...@@@.@@...@@@@@@.@.@.@.@@.@@@@.@@@.@.@@@@ +@@.@.@@.@..@.@@..@..@@@@.@@@@@.@@.@.@@@.@@@.@@..@@@@...@@@@.@@..@.@@.@@@@.@@@.@@@..@@.@.@@.@..@@....@.@@@.@@@@@@.@@.@@@.@@@..@.@.@@...@@@@.. +.@@@..@@@..@.@.@@@@@.@..@@@..@@@.@@@@@.@.@..@@...@.@@@@.@@@@@@@@@.@@@..@@@@@@@@@@@@.@@@@..@@@..@..@@@@@@@@..@@@@@..@@..@@..@@@@..@@@@.@@.@@. +@@.@....@@@@@@@@..@.@@@@@@@.@@.@@@@..@@@@.@@..@..@@.@@@@..@@@@..@@...@@@@@.@@@@@@@@@..@@@@@.@@@.@@@.@..@@.@.....@@@@@.@@@@@.@@@.@@.@@@@@@@@. +.@@@.@.@..@@.@@...@.@.@.@.@.@@@@@@.@@@@@.@@@.....@@@@.@.@..@@@.@@@@@@@@.@@@@@@..@.@..@@@.@@@@@..@@@@@...@@@@@.@@@.@...@@..@@@@@@@@@@.@@@.@.@ +@..@@@@..@@..@.@@..@@@@@@@@@.@.@@.@@.@@@@@.@@@@@@@@@..@@.@@@@@@.@@@@@@..@@@.@..@@@@@@@@...@@@..@@..@@@@.@.@@@@@@....@....@@@...@@.@@@@@@@@.@ +@@@.@@@@@@.@@@.@@.@.@@.@.@..@@@@..@@@@..@@@.@.@.@@@@@@.@.@.@@@@.@...@.@@@.@.@@@@.@@.@@@@@@.@@@.@@.@@@@.@@.@@@@@@@@@@....@@.@@.@.@@.@@@@@@@.. +@@.@@.@@@....@@.@@.@@@@@@..@@@..@@@...@..@@@@@..@.@.@.@@@@@@@.@@.@@@.@@..@@@@.@..@@@.@@@@@.@.....@..@@@@@.@..@@.@@..@..@@@..@@@@@@@...@@@@@@ +@@@....@@@@@@@.@@@@@@@@@...@@.@..@.@@@@@..@..@@@@.@@@@@@.@@.@.@.@.@.@@@@.@@.@.@@@@@.@@@..@@@....@..@.@.@@.@.@.....@@@@@.@@@@.@.@@@@.@.@.@... +@@@.@.@@.@@@@....@@@@.....@.@@@..@@.@.@.@...@@@@.@@@@@@@.@@@@@.@..@.@.@.@@@.@@@@@..@@@@@.@@.@.@.@.@.@@..@.@.@@@@@@@..@...@..@@.@@@@@...@.@@@ +@@@@@@@@.@@@@@@@.@@@@@@@@@@@@.@@@@@@.@..@.@.@@..@@.@@.....@@@.@.@@@.@.@@.@..@@@.@.@@.@@@@..@@.@@@....@@@@.@@..@@@.@@@@@@@.@@@@...@@@@...@.@@ +.@@@@@@@@@.@@@@@@@..@@@@@@@@.@@@@@@@.@@@@@@@...@@@.@@@.@@.@@@.@..@@@..@@@.@..@@@@@@.@@@..@@@@@.@@@@@@@@.@@..@@@@@.@@@.@.@.@@@....@.@..@..@@@ +@@...@@@@@..@..@@.@@..@@.@@..@@.@.@@@@@@.@@@@.@@@...@@..@@@@@@@@@@@..@@@.@@@@..@@..@@@@@@@@.@@.@.@@..@@@@@@.@@..@@.@.@@@@@..@@@@@@..@@..@@.@ +@.@@@@@.@.@@@@@.@@.....@@@.@.@@@.@@@..@@@@.....@.@..@@@...@..@@.@@..@@@....@@.@.@@@@@@@@@@@@@@@..@@.@..@.@@@@@@@.@@..@.@.@@@@@@@@@@@.@@@@.@. +...@.@.@@@@@@.@@@..@@..@@@...@@..@.@..@@@@@@@@@.@@..@@..@@@@@.@.@@.@@@@@@@.@@@@@@@@.@..@.@..@@@@@@.@@@@@@.@.@@.@..@@@.@@@@@@@@@@@@@@@@.@@@@@ +.@@@..@@.@..@@@..@..@@@@..@..@@@@@@@@@@@@@@.@@@.@@@@.@@@@@.@@@....@.@@@@.@.@@@@.@.@.@.@@.@@@@.@@..@..@@@@@@...@@..@.@..@@@@.@.@@@@..@..@@@@. +@@..@..@..@@@@@.@@@....@@.@..@.@.@...@.@@.@@.@@@.@@.@@@@...@@..@@@.@@@@@@@@..@@@.@@@@@@.@@.@@.@@@@@@@.@@@@@.@@...@@@@@..@@@@@@@.@@@@...@@@@. +.@@.@@..@@@@@@..@@@@@@@@@..@...@.@@..@.@....@.@@@@.@@@....@..@...@@@@@.@..@.@.@@@.@@@@@..@@.@@@@@...@..@.@@...@@.@@@@@@@@.@@.@@@@.@.@..@.... +..@@.@..@@@.@@.@.@@..@.@@..@...@..@@.@@@@@@@@@@@@.@.....@.@@@.@@@@@...@@.@@@.@.@@@@@@.@@.@......@@.@@@..@....@@@@..@..@...@.@@@.@....@@@@@@. +@@@@.@@.@.@@...@@.@..@@@@.@@...@.@@@@@.@@@..@.@.@....@@@@.@@@@@.@@@@@@@@@..@@@.@.@..@@.@@@@@@.@.@.@.@.@.@.@@.@@@.@@@@@@.@@.@.@@.@@...@@@@.@@ +@@@@.@.@.@@@.@@..@.@@@.@@..@@@@.@.@@@@@@.@..@.@.@...@@.@@@.@.@@@@@@.@@.@.@.@.@@@@.@@@....@@@@@.@@.@@@@@.@@@@.@@@@@..@.@..@.@@@@..@@@..@@@.@@ +...@.@.@@.@@.@@.@@@.@@@..@@@@@@@@@.@@@@@@@@..@...@..@@..@.@@@@..@@@@@@.@@@@@@@@@@@@...@@.@..@@@...@..@@@@..@..@@@@@@@@..@.@@@.@@@.@@@@@@@@@@ +@.@.@@@.@@.@.@@@@@.@@@@@@@@@@@..@.@@@@@.@.@.@@@@@@@@..@.@.@@...@@.@@.@@.@@@.@@@@@.@@@.@.@@.@..@.@@@@.@@...@.@.@@.@..@....@..@@@@@@.@@.@@@@@@ +..@.@@.@@@.@@..@@.@@.@@..@@.@@@@@@.@@...@@..@@@@...@.@@@.@@@@@@@@@...@@@.@@@@@...@@.@@..@@..@..@.@.@.@@@@.@@.@..@@@@@@..@@@@@@@@@@@@@@@@@@@@ +.@@.@@.@...@@....@@.@.@@..@.@.@@.@@@@..@@@@@@...@@@@@.@....@@.@..@@@..@@.@....@@.@@@.@....@@@.@.@@@@.@..@.@.@@@@.@@...@.@.@@@@....@@.@@.@.@@ +...@@@@.@@@@.@@@.@...@..@@.@@@@.@@@@@..@.@@@@@@@....@....@.....@.@@.@.@@@@@.@@..@@@...@@@@.@@..@@..@.@@.@.@@.@.@@.@..@@@@@.@..@@.@@@.@@@@@@@ +@@.@@@..@@@.@@@..@@@.@..@@@@@@.@@@@.@@@@@@..@.@.@.@@..@@@@.@@@.@@.@@@@.@@@@@@@..@@@@@@@@..@...@@@@@@.@@@....@@@@.@@@@@.@@@.@@@@@@@@.@@...@@@ +..@.@@@@..@@....@@@.@@.....@@@@@@@@.@..@.@..@@...@.@..@@@.@@@.@...@@...@@@@.@.@@.@@@...@..@@@.@..@.@@@@@.@@...@@@..@..@@@..@@.@@@@@@..@@@@@@ +.@...@.@@..@@@.@.@@.@@...@.@@@@.@@@@@@..@@.@@@@....@..@.@@.@@.@@.@@@.@.@@@@.@.@@..@@@@@..@.@@.@.@@.@@@@...@@...@.@.@@@.@@@.@@.@@@@@@@.@@@@@. +@@..@@@@@.@...@..@..@@@..@@@.@@@@..@.@@.@@@@.@@.@@@@...@..@@@@@@@@@@.@@@@@@.....@@....@@...@@@@@..@@@.@@@@@@@@.@@@...@.@@.@@..@.@..@.@@@@@@@ +.@..@@..@...@@.@@@.@.@..@@..@.@.@.@..@@@@@@..@..@..@@@@@@.@@.....@.@@@@@@@.@.@.@@.@@@@...@@@@@@.@.@@.@@@@@.@..@@.@.@@@@@@@@@@@@..@@@@.@.@.@. +@...@@@@@...@@@@@@.@@.@...@.@@@@@@@@@@..@.@@@..@@.@@@..@@@@@@..@@@@@.@@..@@@@@@@@.@@@@@@@.@.@@@@.@@@@@@@...@@@@@@.@.@.@@@@..@@..@.@.@@@@@@.@ +.@..@@.@@.@@@.@@.@@...@@@.@..@.@@.@@@..@@..@@@.@..@@@@@.@.@@..@.@..@...@...@...@@.@.@.@.@@.@@.@@.@@@@..@@@..@@.@@.....@@@@.@...@@.@...@.@@.. +@@.@@.@@.@@@@@@@.@@.@..@@@@@@@.@...@.@@@..@@..@@.@@@@..@@@@@@.@@@@@.@@@@@@@.@.@.@.@.@.@.@.@@@@@@@..@@@.@@@.@@.@.@@@..@@@.@@@.@@@@.@@@@.@.@.. +@@.@..@@@..@..@.@@@.@@@@@@.@.@@@@@@@@@..@@.@@@@.@.@.@@.@@.@@@@@@..@...@.@@@@@@@@@@@@.......@@@..@...@@@@@@@..@.@@@@@@@@@....@@@@@@@@@@.@@... +..@.@@@.@@..@@...@.@@@@...@.@@@@..@@@.@..@.@...@@@.@@.@@@@@.@.@@.@@@.@@.@@@@@.@@@.@@.@@@..@.@..@@@@@@@..@@@@@...@....@.@@.@@@..@@@@.@@.@@@@@ +@@@.@.@.@@@@@@@@@@@...@..@@@@...@@@@@.@...@@@@@@.@@@..@@@@..@@@@@@@@@@@@@@@@.@@@..@@.@@@@...@..@......@.....@@@.@@@@@@@@@.@@@..@@@@@.@@@.@.@ +@.@.@@.@@.@.@..@.@@.@@@@@..@..@@@@@@.@@@@.@@@@@.@@@@@@..@@@..@@@@@@.@.@@....@..@@@.@@@..@@@@...@@.@@@@@@@@.@@.@.@.@.@@.@.@.@.@@@@@@@..@@@..@ +@@@@@@@..@.@@@.@@.@..@@....@.@@.@@.@@@.....@@@@@@@.@@.@.@@..@@@@@@@...@...@.@@@@@..@@@@@@.@@@@.@@...@@@...@@@@@@.@@@@.@.@@.@....@@@.@@@@@... +@....@@.@.@.@...@@@..@.@@@.@@@@@.@@@.@...@@.@@.@@..@.@....@.@@.@.@.@.@.@@.@@@@.@@.@@..@@@@@@@@@..@.@@@.@@.@.@@@@@@@@@@@@.@.@...@..@.@@@..@@@ +.@@.@@....@@@.@@@..@.@.@..@.@@..@..@@.@@..@.@@@@@@.@@.@@@@@.@...@@@@@.....@@@....@.@@.@@@@@@.@@@@...@@.@@.@@.@@@@@@@@@.@@@@...@@.@.@@.@@@.@@ +..@@@.@@@.@@@..@@...@@@@@@@@@@.@.@@@@@...@@.@@@@@.@@@..@.@...@@.@@.@@.@@.@@@@@.@.@@@..@@@..@@.@.@..@@@..@@@@.@@@@@@...@@.@@.@.@..@@.@@@.@@@. +.@@@.@@@@@@.@@@@@@.@@.@..@.@@@..@@.@@@@.@@@.....@@.@@.@.@.@@@.@@..@@@@@@.@@.@@...@.@@@@@@@.@@@..@.@@..@@@@..@.@@@.@@@@@@@@@.@@@@.@@@@.@@@@@. +@@.@@@.@@@@.@@.@@@@.@@@..@@@@@@@.@...@@.@@..@@@@@.@@@@@@.@...@@.@@.@@@@@.@@@.@@@@@@..@.@@@@@@@@@.@@@.@@.@.@.@@@.....@..@@.@@.@@...@.@..@..@@ +.@@...@@@@.@@.@@@@@@@.....@@@@@@.@.@.@.@@@@@@@@...@.@.@.@@.@@.@.@.@@.@@@@.@@.@.@@@@@..@@@@...@@@@@.@@@@@.@..@@@.@@@@@..@@@@@@.@@@..@.@@...@. +@@@@@@@@@.@@@@@.@@@@..@.@@@@@@@....@@@@......@.@.@.@@@.@.@.@@@.@.@@.@@.@@@@.@@..@..@@@@@@.@@@.@@@@@@@@@@@@..@@@.@@...@..@.@.@.@..@@.@@.@@.@@ +@@....@@@...@@@@..@.@.@.@@@...@@@.....@@......@.@@.@@@..@@@@@@.@@...@.@@@@@@@@.@....@@..@...@.@@...@@@@@@..@@.@@.@@@.@.@@.@.@.@....@..@@.@@. +@.@...@@@..@@@@@@@@...@...@@@@.@@@@...@..@.@.@@.@@@@@.@@@@@.@@.@@.@..@@.@@..@@....@@.@@@@@.@@@@@@@..@@@@@..@.@@.@@@.@@.....@@@@.@.@.@@.@@@@@ +@@@@.@@..@.@.@....@@@@.@@.@@...@@..@@@@@@.@@.@..@@@@@.@@@..@@@.@@@..@@@@@@..@@..@@...@@@..@@@.@@.@@..@@.@@@@....@......@.@@@.@@@@@.@@.@@..@@ +@@@@@.@@.@@@@.@..@@..@...@@@@.@@..@@@@@.@@.@@@@@.......@@..@@@@@@@..@.@.@@.@@@@@@@.....@.@@@.@@@@@.@...@@.@@@@@.@@@.@@@@@@@.@@@.@...@.@.@... +.@@..@@.@@..@@@.@@..@@.@@@.@.@.@@@..@..@@@.@@@@@.@.@.@.@.@.@@@..@@..@@.@...@@@..@...@@@.@@@@.@@@@@...@@@..@.@@.@.@.@@.@@@@@@.@@@.@.@@.@.@.@@ +.@@...@@....@@@@@@.@....@@@@@.@.@.@@.@@@@.@.@@@@@.@@@@@@@@....@@@.@.@@...@@@@@.@@@@@@.@..@@.@@.@@@@@@@@..@@.@.@@@..@@@@@@@@.@@..@@@.@@@.@@.@ +.@.@@@.@@@.@.@@...@..@@@@@@...@@@@..@@@@@@@@.@.@@.@@@.@.@@@@..@.@@.@@@@@.@@@@@.@@@@..@@@@@@@@.@@.@@@.@..@@@@@.@@..@@..@.@@@@.@..@.@..@@..... +...@@..@@.@@@.@.@@@@@@@@@..@@@@@@..@.@@@@......@...@.@...@.@@@.@@....@@.....@@.@@..@..@@@@...@..@@..@@..@@.@.@@@.@.@.@@.@.@@.@..@@..@@..@@@@ +.@@@@@@@.@.@@@@@@@@.@@@@@@..@@....@.@@@@@...@@@@@.@.@.@@..@@@@@..@@@@@@@.@@.@@.@@@...@@.@.@@@@.@@@@@.....@..@.@@.@@.@.@..@@@.@.@.@..@@..@@@. +@@@@@@@@..@@.@@.@.@@@@@@.@@.@@@@@.@...@@@@...@.....@@@....@@.@@@@@@@..@@@.@@@@@....@@..@@.@@@@.@@.@@@@@@@.@...@@.@@@.@.@@@@@@.@...@...@@.@@. +@@.@.@@@..@@@.@.@@.@@@.@...@@..@@@.@.@.@@@.@.@...@@.@@@@@@@.@@.@@@@@..@@@@.@@@.@@@.@@@@@@@..@.@@.@@.@..@@@@@.@..@.@..@@@....@..@..@@@@.@@..@ +@.@@@.@@@.@...@@@.@@@@@@@.@@@.@...@.@@@@...@@@@@.@@@@@@@@@@..@@@@@.@@@@.@@@.@@.@@.@..@@.@@@@@.@@@.@@@@@.@@.@@@.@.@.@.@.@.@@@@...@..@@@@@..@@ +...@@@@@.@.@.@@@@......@..@.@@@@@@@.@@@@@@.@@@.@..@@@..@.@@@.@.@@@@@@@.@.@@@@..@@.@@@@@@@@@@..@@@@@@@@..@..@..@@@@...@@@..@..@.@@.@@.@.@.@@. +@...@.@@@.@@.@@..@@.@@...@@@.@.@@.@@@@.@..@@@@@@@@@.@.@@.@@@@@@.@@.@.@@..@@@..@@@@..@@....@.@@@.@@@..@@@.@..@@@@@@@@@@.@.@@@.@....@@@@.@@@.@ +@@@.@.@@@@@..@.@.@.@@.@..@@...@@@@..@@.@....@@.@.@@@@.@@.@@@.@@.@.@@.@.@.@.@@..@@..@@@@@@@@@.@@@@@@.@@@@@..@@.@@.@@@.@@.@.@@@@.@..@@.@@..... +.....@@@@@@..@@..@....@@@@@@@..@@@@..@.@.@.@@.@....@@@@@.@@...@..@@.@.@..@@@..@.@@@@...@@@.@@@@@@@@@@@@.@.@@@.@.@@@..@@@@.@.@@.@@@@....@@@@. +....@@.@.@.@@@..@@@.@@@@@@@@@.@..@.@.@@@.@...@@@@.@@.@.@@.@..@..@@@@@@@...@@@...@.@@.@@@@@@@..@@@@@@@.@@.@@@@@@.@....@.@@.@.@@.@@@@.@@@@...@ +.@@@.@@@@@@..@.@@@@.@@.@.@@@.@@@@@@@@.@@@@@@@@@@@.@@..@@@@@...@@@@@@@@@.@@@@@@@.@..@@@@@.@@@@@@@@@@@....@@@.@@@.@@@@@@.@@@.@@@.....@@@.@@@.@ +.....@@@@.@@.@..@@@@@@@@.@@@@.@@@@..@@@@.@@@..@.@@@.@@.@.@@.@@@@..@@@..@@@@@@...@@@.@..@@...@@@.@@@@@.@@..@..@.@@@@@.@@.@@.@..@....@@.@..@.@ +.@.@.@@.@@@.@@.@.@@@@@......@@@....@...@.@@@@..@@@..@.@.@@@.@.@@.@@@.@..@.@@@.@@...@.@@.@.@.@@@@@@..@@@@@@@.@@.@@@.@.@..@@@@..@@@.@@.@..@.@. +@.@.@@@@.@.....@@..@.@@@.@.@..@@@.@.@..@.@@@@@@@.@@@@@..@@..@@@@@.@@...@@.@@@.@@.@.@@@@@@@@@@@@...@@@.@@@@@.@@@@@@.@@.@@@@@@..@.@@@...@@@@.. +@@@@@.@.@.@.@@@@@@@.@.@@@@..@@@@.@@.@@...@@.@@...@@@.@@.@.@@@@@.@@@@@@@..@@@@@@..@@.@@.@.@@.@.@@@@@@@@.@@@@...@@..@@@.@..@..@@.@..@@@..@@@@. +.@.@.@.@@@@@@@@@.@@.@@.@@@.@@@@@..@.@..@@@.@@@..@@.@@.@@@....@@@@@....@@@@@.@@@@@@@@.@@.@..@@.@...@.@.@.@@..@@.@.@.@@@.@@.@@@@@..@@@.@@@@@.. +@@@.@@.@@@.@@@@@..@@@@.@@@.@@@@@.@@..@@.@.@..@@.@@.@@.@@..@@@@@@.@@@@@.@.@.@..@@@.@@@....@@.@@..@@@@@@@@@@.@.@@@@@@...@.@@..@@@@..@@@@.@.@@@ +.@@@..@@@.@.@@@@@@.@.@@@@.@@@@@@.@@@@@.@@@@@@.@@@@.@@.@@@@@@@@@@@@@@@@@@@.@@@..@@@@@@..@..@@.@@@@@@@..@....@@..@.@@.@@.@@..@@@.@.@@..@@..@@. +@@@.@.@@@@.@@@@@@.@@.@.@@..@@@..@@@..@.@.@.@@@@@@@@@@@@..@@@@@@@@@@@.@@@@@@..@.@@@@....@@@@@@...@@.@@@.@.@@@@.@.@.@@.@@@@@....@@@@..@@.@@@@@ +.@@@@@@@@@.@.@@.@.@.@@..@@@.@..@@@.@@@@@.@@@..@@@..@@@@@@@@@@@@.@@@.@@@@@@...@@.@@...@@@@.@....@..@@..@@.@@@.@@@.@..@.@@@@.@.@@@@.@....@@@@@ +@.@@.@@@@@.@@.@@@@@@@@@@..@@@@@@@@..@.@..@@@@.@.@.@@@@@@.@@@@@..@.@@@..@@@@.@@.@.@@@@.@.@@@@@@@@.@@@.@@@@@.@@@...@@@@....@.@@.@.@...@..@.@@@ +..@@...@@@@@@@.@.@@..@@@@@@@....@@.@@..@..@@@.@..@@.@.@@@@@@@@@@...@...@@@@@@@.@.@@@@@@.@....@@@@......@@@.@@...@@@@@@..@@@@@@@@@@.@@@@@@@.. +@@.@@..@@@@@@@@.@.@@.@@@.@.@@@@@@@.@@@@@@@.@@.@..@@@.@...@.@@@@...@..@@...@@@@@@.@@@@@.@@@..@@@@.@@@@@@...@@@.@.@..@..@@@@@.@.@.@.@@..@@@... +@@.@@@@.@.@.@@.@.@.@...@@@..@..@@@@@.@...@@@@.@.@@.@@..@@@..@@...@@@..@@@..@@@.@@.@.@.@.@.@@@@@..@@@@..@@@@@@..@@@@@@@@@@.@.@..@@@.@@@..@.@. +...@@@@@@@@@@@.@..@@...@@@@@@@@.@@@.@@@.@.@@@@.@@...@.@@..@@@@@..@.@@@..@.@@@@@.@..@@.@@@@@@@.@@@@@@@..@@@@.@...@.@@@@@@..@.@@@@@@@.@..@.@@. +..@@.@@@.@.@.@@@.@@.@.@.@@@.@@@@@@@.@@..@..@@@@@@@@.@@.@@@..@@..@@@@@.@@@@.@.@.@@@..@..@@...@...@@@@.....@@@.@.@.@..@.@@@@@@@@@@...@..@@@@@@ +@@...@@@@@@@@.@@@@.@.....@@@@@@@@.@@...@@@@@.@@@..@....@@....@.@@.@@@.@.@@@@@@..@...@..@@.@@@@@@@@@@@@@@...@@@@@@.@@@@@@@.@@.@.@@@.@@@@.@@@@ +@@@@...@@@@.@@.@...@@.@@@@..@@.@@.@@@@.@.@@..@@.@.@.@.@.@@@@....@..@@@@.@@@@@@@@@@@...@@.@.@.@@@@@@.....@@@@@@.@@@@@@.@.@..@@@@@.@...@@..@@@ +@..@.@@@...@@@@.@@@@@@.@@@.@.@@@..@...@.@@@@@.@.@@@@@@@@@@..@@@@..@@@.@@@@@@@@@@@@@@.@@@@@@@@@@@@..@@.@...@@.@@@..@@@@.@@@@@...@.@@@.@@..@@. +.@..@@..@..@@@@.@.@@.@@@@@.@@...@@@.@..@@@@@@@@..@..@@@@@@@.@@@@@@@@@@@.@@@@@@.@@..@@@@.@.@@.@@..@.@@@@.@@@.@@@@...@@@.@.@@@....@@@.@.@@@@@@ +@@@@.@.@.@@@@@@@@.@@@@@.@@...@@@@@.@@.@@...@@@@@@..@@@@@@@.@..@...@@@.@.@.@@@...@@@.@..@@.@@@@...@@@@@..@@..@@@.@@@.@.@.@@@@@@@@.@.@@@@@@@.. +.@@..@@..@@@@@@@@@@.@.@@@..@@@@@..@@.@@.@.@.@.@@@@.@@@@@@......@.@@@.@..@@....@.@.@@@@..@.@.@@@@@@@..@@@@..@@@@@.@@..@@.@.@@@.@..@.@@@@...@@ +.@.@@.@@@@@....@@@@...@@@@@.@@@.@.@@@@@@@...@.@@@@@@.@@@@@@.@@@@@.@..@.@@.@@..@.@...@@@.@..@@@..@..@.@...@@......@.@.@@@@@@..@@@@@@@.@@..@.@ +.@@.@@..@@@.....@.@@..@.@@@@.@.@@@@@.@@@@...@@@@.@.@...@.@@.@@.@......@.@@.@.@@..@@..@.@@@@.@@@.@..@.@@@@.@@@@.@@@@@@@@@.@@.@@.@@@@@@@@@@@.@ +@@@@.@@.@@@@.@@@..@@@@@@@@.@@@.@@@@@@@@@@....@@.@.@@.@@.@.@.@@@@.@@.@.@@@@..@@.@....@@@@@.@@.@@.@@.@.@@@@@@.@@@@@@@@..@.@...@@..@@@@..@@@@@@ +@.@.@..@@.@.@@@@.@@@.@@.@@...@@@@.@@.@.@@..@@..@@.@@.@.@.@@@@.@@.@..@@@@@@.....@@@.@.@@@@@@.@@@.@.@..@.@@@.@....@@@@@.@@@@.@@.@@@.@....@.@@. +@@.@.@@@.@@@.@@.@.@@@@@@@.@@.@@.@@.@.@.@..@@@@@@.@@@.@.@@@.@...@@@@@.@.@@.@.@...@@@@.@@.@@.@.....@.@@....@@.@..@@@@@@@@@.@.@@@@....@@@@.@.@@ +@@@@@.@.@.@..@.....@@@@@@.@.@..@.@.@@@..@@@@@@@@@@.@@.@@..@.@@@@@.@@@@@@@@@@..@@.@@@@.@@.@@.@@@.@@.@@@.@@@@.@@@.@@@.@.@@@@..@@@.@.@@@.@..@@@ +..@..@@@@@@@@....@@@...@@@@..@@...@@.@@@@@@....@.@@@@@@@..@@@@..@@@@@@.@@@.@.@@.@@@@@@@@@@...@.@.@@...@.@@@..@..@.@.@@@@@.@@.@@.@@....@@@.@@ +@@.@.@.@@@@@@..@@.@.@@.@@.@@@..@@@@@@@@.@.@@@@@@.@@.@@...@...@@..@..@@@@...@.@@@@.@@@@@.@@.@@@@@..@.@.@.@@.@@@@@.@@@.@@.@.@.@..@..@@.@@..@@@ +@@@@.@@@@..@.@@@@@@@@.@.@..@..@.@...@.@@@@@@@@.@@..@@@@@.@@@@.@...@.@.@@@@..@.@@@.@@@.@@..@@@@@..@@@@..@@@@@@@...@..@.@.@@.@@.@@.@@...@@@..@ +@@@.@@@@@@@@@.@@@@@.@@@@@@@@@@.@@@@.@@.@....@.@.@.@@@.@..@@.@@.@....@@.@@@...@.@..@.@@@@@.@@@@.@@.@@@@@@.@@@..@.@@..@@@.@@.@@@.@.@.@@@@.@@@@ +.@@@@@....@.@@@@@@@@..@.@@.@.@.@.@@.@@@...@.@@@@@@@..@@@.....@@....@@@@@.@@.@..@@@.@@@.@@.@@@@@@@...@.@..@@@@@@@@@@@@@@.@@@@@..@@@@..@@@@.@@ +@@@@@@@.@@@@.@@@@.@@.@@@.@..@@.@@@@@.@.@@@@@@.@..@.@.@...@@@..@.@...@.@@.@@@.@@...@@..@...@@@.@.@..@@@.@@@@@@@@@@.@.@..@@.@.@@@@@.@@@..@@@.. +@@@.@..@@@@@...@..@@@.@@@@.@@.@.@@@@@@..@@.@.@.@@.@@@@@@.@...@@@..@.@@@.@@@@@.@@@.@@@....@.@@.@.@@@@.@.@@@@.@@..@@@.@.@@.@@..@@@@@..@@@...@@ \ No newline at end of file diff --git a/advent_of_code_2025/src/day4/mod.rs b/advent_of_code_2025/src/day4/mod.rs new file mode 100644 index 0000000..8e2a92e --- /dev/null +++ b/advent_of_code_2025/src/day4/mod.rs @@ -0,0 +1,2 @@ +pub mod part1; +pub mod part2; \ No newline at end of file diff --git a/advent_of_code_2025/src/day4/part1.rs b/advent_of_code_2025/src/day4/part1.rs new file mode 100644 index 0000000..2d92e09 --- /dev/null +++ b/advent_of_code_2025/src/day4/part1.rs @@ -0,0 +1,52 @@ + +fn print_department(department: &[Vec]) { + for row in department.iter() { + for col in row.iter() { + match *col { + b'.' => print!("."), + b'@' => print!("@"), + b'X' => print!("X"), + _ => print!("!") + } + } + println!() + } +} + +pub fn solve(input: &str) { + let department = input.lines().map(|str| str.as_bytes().to_vec()).collect::>(); + let mut updated = department.clone(); + + let mut counter = 0; + + for (row_idx, row) in department.iter().enumerate() { + for (col_idx, fill) in row.iter().enumerate() { + if *fill == b'.' { + continue; + } + + let row_start = (row_idx as i64 - 1).max(0) as usize; + let row_end = (row_idx as i64 + 2).min(department.len() as i64) as usize; + let col_start = (col_idx as i64 - 1).max(0) as usize; + let col_end = (col_idx as i64 + 2).min(row.len() as i64) as usize; + + let mut count = 0; + + for row_step in row_start..row_end { + for col_step in col_start..col_end { + if department[row_step][col_step] == b'@' { + count += 1; + } + } + } + + if count < 5 { + updated[row_idx][col_idx] = b'X'; + counter += 1; + } + } + } + + // print_department(&updated); + println!("moveable rolls: {counter}"); +} diff --git a/advent_of_code_2025/src/day4/part2.rs b/advent_of_code_2025/src/day4/part2.rs new file mode 100644 index 0000000..f351dc9 --- /dev/null +++ b/advent_of_code_2025/src/day4/part2.rs @@ -0,0 +1,77 @@ + +fn print_department(department: &[Vec]) { + for row in department.iter() { + for col in row.iter() { + match *col { + b'.' => print!("."), + b'@' => print!("@"), + b'X' => print!("X"), + _ => print!("!") + } + } + println!() + } +} + +fn update_department(department: &mut Vec>) -> usize { + let mut remove_count = 0; + + for rows in department.iter_mut() { + for fill in rows.iter_mut() { + if *fill == b'X' { + *fill = b'.'; + remove_count += 1; + } + } + } + + remove_count +} + +pub fn solve(input: &str) { + let mut department = input.lines().map(|str| str.as_bytes().to_vec()).collect::>(); + let mut updated = department.clone(); + + let mut counter = 0; + + loop { + for (row_idx, row) in department.iter().enumerate() { + for (col_idx, fill) in row.iter().enumerate() { + if *fill == b'.' { + continue; + } + + let row_start = (row_idx as i64 - 1).max(0) as usize; + let row_end = (row_idx as i64 + 2).min(department.len() as i64) as usize; + let col_start = (col_idx as i64 - 1).max(0) as usize; + let col_end = (col_idx as i64 + 2).min(row.len() as i64) as usize; + + let mut count = 0; + + for row_step in row_start..row_end { + for col_step in col_start..col_end { + if department[row_step][col_step] == b'@' { + count += 1; + } + } + } + + if count < 5 { + updated[row_idx][col_idx] = b'X'; + // counter += 1; + } + } + } + + let removed = update_department(&mut updated); + counter += removed; + department = updated.clone(); + + if removed == 0 { + break; + } + } + + // print_department(&updated); + println!("removed: {counter}"); +} diff --git a/advent_of_code_2025/src/day4/test.txt b/advent_of_code_2025/src/day4/test.txt new file mode 100644 index 0000000..9ad769d --- /dev/null +++ b/advent_of_code_2025/src/day4/test.txt @@ -0,0 +1,10 @@ +..@@.@@@@. +@@@.@.@.@@ +@@@@@.@.@@ +@.@@@@..@. +@@.@@@@.@@ +.@@@@@@@.@ +.@.@.@.@@@ +@.@@@.@@@@ +.@@@@@@@@. +@.@.@@@.@. \ No newline at end of file diff --git a/advent_of_code_2025/src/main.rs b/advent_of_code_2025/src/main.rs index 9197db4..d4e85bf 100644 --- a/advent_of_code_2025/src/main.rs +++ b/advent_of_code_2025/src/main.rs @@ -1,5 +1,5 @@ use paste::paste; mod utility; -solve_day!{3} -// test_day!{3} +solve_day!{4} +// test_day!{4}