Skip to content

Commit 6f37dbf

Browse files
committed
Add 2024 day06 (incomplete) solution
1 parent fdf7d74 commit 6f37dbf

File tree

6 files changed

+526
-0
lines changed

6 files changed

+526
-0
lines changed

2024/day06/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Day 06 - Guard Gallivant
2+
3+
> [!NOTE]
4+
> Input link: <https://adventofcode.com/2024/day/6/input>
5+
6+
## Part 1
7+
8+
> [!NOTE]
9+
> Problem link: <https://adventofcode.com/2024/day/6>
10+
11+
### Part 1 Solution
12+
13+
```bash
14+
$ cargo run --release -- --input 2024/day06/input.txt 2024 06 part1
15+
5409
16+
```
17+
18+
## Part 2
19+
20+
> [!NOTE]
21+
> Problem link: <https://adventofcode.com/2024/day/6#part2>
22+
23+
### Part 2 Solution
24+
25+
> [!CAUTION]
26+
> Solution is incomplete. Answer for input example is OK so I am
27+
> probably missing an edge-case. I've printed the map to try and
28+
> trace back the path manually but 475 possible obstructions is a
29+
> very large amount, therefore I decided to abandon for now.
30+
31+
```bash
32+
$ cargo run --release -- --input 2024/day06/input.txt 2024 06 part2
33+
475
34+
# Wrong answer, too low :(
35+
```

2024/day06/input.txt

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
..#.........#...#......#...........#.#...#............#...#.........#....#......................#......#..........................
2+
...........#....#.............#.....................................#............................................#.....#..........
3+
.................#.........#.......#.......#..#............#.........#.........#............................................#.....
4+
......#................................#.........................................#................................................
5+
#...............................##......#.#...........................#....................#...#...............#.................#
6+
.............#......#...........................................#..............#..........#..............#........................
7+
...#...................#..............#........#.......#..........#.........................#.#.....#.....#.......................
8+
#.#...#.............................#.................................................#..............#............#...............
9+
.............................#.......#.............#......#...............#.....#.................................................
10+
....................................#.....................................#.................#........#..........#.#..#...........#
11+
......................#......#...............................#.................#.......#......................#.......#...........
12+
...#..............#....................#............#...........##..#.....................................................#.......
13+
....#.........#...................................#................................................#..........................#...
14+
..............#.....#.................................................................#..#.....##.......#.........................
15+
.........#....#...........##..........................................#......#.....................#..........#.......#...........
16+
..#....#..........#.................................................................#....#............#............#........#.....
17+
............#.#....#...........#.............#...........#..................#.....#.................................#.......#.....
18+
..........#.......#............................#........#...........#.......#...#....#........#.............##.#............#.....
19+
...................#.........#....#.....................................................................#.#..........#............
20+
.#...#.#..................#...............................................#...........................#......................#....
21+
.........#..............#.........#.......#.#......##..................#......#...#..#...........#.....................#..........
22+
...............................#.............#..#......#............#..........#......................#..........#.............#..
23+
..........#.....#..........................#..................................................#.#..#.....#........................
24+
............#..##.................................#....................#.....#.......................................#............
25+
......................#.#...................#......#..............................................................#...............
26+
.......#.............................................................................#............................................
27+
........#.................#....................................................#.......................................#....##.#..
28+
..................#........................#......#..##....#.........#...##..#....................................#...............
29+
.............#..............................................................................##...#......#.................#.......
30+
..................................#.#.............................................................................#...............
31+
...........#.................................#.......................................................................#......#.....
32+
.....#............................................................#................................................#..............
33+
.....#...........#.#..........#..............#..........................#.................................................#.......
34+
....#........#...#..........#..#..........................................................................#.......................
35+
.........................................................................#.....#.......................................#....#.....
36+
...............#...#..#.....#.......................#.................#........#..........##....................................#.
37+
.......................#....#...#..................#..................#.....................................#.............#.......
38+
...........#..#...#..............................................^........#........................#......................#.......
39+
.............................................#.................................................................................#..
40+
......#...#.........#.....................................#...............................................#..#....#.......#.......
41+
...#......................................................#.................#..#.............................................#....
42+
.....#......................#.......................................#.............................................#....#..........
43+
...#.....................................................#......#...#.......#....#..............................#....#............
44+
......#.....#.....#...........#...#................#...........................................#..................................
45+
...................................#...............#......................................................#.......................
46+
..............................#...#........................................................#.#.............#......................
47+
......#.......#............#..#......................#..#.....#..................#......#.........................................
48+
#......#....#.......#....................#.....#.#............................................................................#...
49+
.#....#...................................#.................#....................#........................................#.......
50+
............................................#...................................#.......#..............#.........................#
51+
............##.........#..............................................................................#.........#.................
52+
##.................................................#.......................#.#.....#..............................................
53+
...........................#..........#...#.#.........................#.................................##.....#..................
54+
.............#..........#........................................#............#............#.....................................#
55+
.....................................................#.................................................#..........................
56+
.....#........................................#.............................#...#.....................#...........................
57+
.......#..................................#...........#.......#.....#........................................#.......#............
58+
.............#.......................#......................#.....#.......#..................................#..#........#........
59+
.......................................................#......#...............#.........#.............#............#..............
60+
....#...............................#.#.....................#.................................................................#..#
61+
...........................#........#..........................................#........................................#.........
62+
....#.............................................................................................................................
63+
.##........#.......#..................#.#....#.............................................................#.##...................
64+
.#..#.......................##........................................................#...............................#...........
65+
.....#.#..............#...........................................#...............................................................
66+
.....#.#............................#.............................................................................................
67+
......................#............................#....#............................................................#............
68+
.......#.......................................................................#..................#...##..........................
69+
...............#...................................................#.....................................#...............#.#......
70+
....#..........#.......#..#................................#......................................................................
71+
#......##..................................................................#...#........................#.........................
72+
..................................#........................................................................#...........#......#...
73+
.#....................#....#..................................#..#..................#.#.......................#...................
74+
......#..#................................................................................................##......................
75+
.....##........#..#.......................#.........#............#....#...........................................................
76+
...............#...........#.................#...........#.........#.......................#.........#........................#...
77+
............................................................................................#..#..................................
78+
..........................................#.............#..#...............#.............................#.#......#.............#.
79+
......................#............#..........#............................................................#...#................#.
80+
...........#...................#..................................................................................................
81+
.......#........................#.................................................................#.................#.............
82+
#...##................#......................................................................#................................#...
83+
...#.....#.......................#...#..............#....................#.........#.........#....................................
84+
....#.....................................#.............................................................................#.........
85+
.........#..............................................................................#..............#..........................
86+
...................................#.#...............#........................................................................##..
87+
.........#............#..............#..........................................................................#...#.............
88+
.....#.......................#..#....#.#....................#..........................................#..........................
89+
.......................................#........#.........#.....................#.............#...........#...............#.......
90+
................#.................................................................................................................
91+
.......#....................................#..................#...........#.....#.........................#......................
92+
...................#................................................................#...............#................#............
93+
..........#.......................#......................#...........#..#........#....#.........................#.................
94+
...................#........................#.......#................................................#............................
95+
.......................#......................................................#...........#.......#...................#...........
96+
........#..........#........#......#......................#......................................#...............#................
97+
...........................................................#...#..................................................................
98+
.......................#......................#............#..#....#...#............................#.............................
99+
.#.#...............#..........#..........##........#..............................................................................
100+
##.........#....................#...................#.........#......................##..................#...............#........
101+
.#......................#...#...#......................#............#......................#.................#..................#.
102+
#..............................#......................................#.........#.#...............................................
103+
...........#....#......#.......#..........................#..........................................#......#............#..#.....
104+
................................................................................................#.......#.........................
105+
....#..................................#..........................#.................................#...#...#.....................
106+
.......................#.#..#.............................#.#...........................#......#..........#.......................
107+
...##.......................................#..................#....................#.............................................
108+
...#.......#........................#..........##.....#............#......................#.....................................#.
109+
......#..............#.............................#.............................................#.............................#..
110+
#...........................................#.......#....#.#..........#........#............#.......................#.......#.....
111+
..................#.......#............#.....#.............................................................#......................
112+
.#.....................................................................................#...................................#......
113+
...........#.........#.#.................#..........................#............................................#.......##.......
114+
.......................#......#.................................................#........................#.................#......
115+
..................#........................................................#................................................#....#
116+
...............................#.......#....#.........#..........#.....#.......................................#..#...............
117+
......##................##...#....#...#...#............................................................................#..........
118+
.......................#............#...................................#....#.......#.............................#..............
119+
..............................#.........................................................#........#.............#..................
120+
........................#............................................#..................#.....#...................#...............
121+
............#......#...............................#.............................................................................#
122+
.#.........#.........#.........#.......#.#..#...#...............................#.......#.........#..........................#....
123+
........................#.................................................#....................................##......#..........
124+
....#.......#.....................##...#..........................................................................................
125+
.................................#.......................................#.......................#.#......#.......................
126+
.#.............#..................#...........................#.................#...........................................#.....
127+
.....#.........#................#..........#..#..........#......................#...#......................#....#.................
128+
.................#......#.....................................................................#...................................
129+
......................#.......................................................#..#......#..............#..#..#..........#.........
130+
...............................#.........#........#..................#.#.........#.#.#........#..#.........#....##...#............

2024/day06/input_example.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
....#.....
2+
.........#
3+
..........
4+
..#.......
5+
.......#..
6+
..........
7+
.#..^.....
8+
........#.
9+
#.........
10+
......#...

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ This repository hosts my solutions (and sometimes attempts) for
1818
- Day 03: [Mull It Over](./2024/day03/README.md)
1919
- Day 04: [Ceres Search](./2024/day04/README.md)
2020
- Day 05: [Print Queue](./2024/day05/README.md)
21+
- Day 06: [Guard Gallivant](./2024/day06/README.md)

0 commit comments

Comments
 (0)