tangled
alpha
login
or
join now
bwc9876.dev
/
advent
0
fork
atom
Advent of Code solutions
0
fork
atom
overview
issues
pulls
pipelines
2024 final cleanup
bwc9876.dev
1 year ago
4b8d262e
5a990294
verified
This commit was signed with the committer's
known signature
.
bwc9876.dev
SSH Key Fingerprint:
SHA256:DanMEP/RNlSC7pAVbnXO6wzQV00rqyKj053tz4uH5gQ=
+833
-77
42 changed files
expand all
collapse all
unified
split
years
2024
src
day_12.rs
day_13.rs
day_14.rs
day_15.rs
day_16.rs
day_17.rs
day_18.rs
day_19.rs
day_20.rs
day_21.rs
day_22.rs
day_23.rs
day_24.rs
day_25.rs
examples
day_12
1.txt
2.txt
day_13
1.txt
2.txt
day_14
1.txt
2.txt
day_15
1.txt
2.txt
day_16
1.txt
2.txt
day_17
1.txt
2.txt
day_18
1.txt
2.txt
day_19
1.txt
2.txt
day_20
1.txt
2.txt
day_21
1.txt
2.txt
day_22
1.txt
2.txt
day_23
1.txt
2.txt
day_24
1.txt
2.txt
day_25
1.txt
2.txt
+1
-12
years/2024/src/day_12.rs
···
86
86
flood = next;
87
87
}
88
88
89
89
-
println!("{c} @ {pos}: area = {area}; perim = {perim};");
90
89
total += area * perim;
91
90
92
91
visited.insert(pos);
···
154
153
}
155
154
}
156
155
157
157
-
let _ = shapes
158
158
-
.iter()
159
159
-
.inspect(|(a, s, p)| {
160
160
-
println!(
161
161
-
"{:?}: {a}; {s}",
162
162
-
input.get(*p.iter().next().unwrap()).unwrap()
163
163
-
)
164
164
-
})
165
165
-
.collect::<Vec<_>>();
166
166
-
167
156
Some(
168
157
shapes
169
158
.into_iter()
···
173
162
)
174
163
}
175
164
176
176
-
day_stuff!(12, "", "", Grid);
165
165
+
day_stuff!(12, "1930", "1206", Grid);
177
166
178
167
fn parse_input(input: &str) -> Self::Input {
179
168
Grid::parse(input.trim())
+1
-1
years/2024/src/day_13.rs
···
74
74
}
75
75
76
76
impl Day for Day13 {
77
77
-
day_stuff!(13, "", "", Vec<Machine>);
77
77
+
day_stuff!(13, "480", "875318608908", Vec<Machine>);
78
78
79
79
fn part_1(input: Self::Input) -> Option<String> {
80
80
Some(
+18
-9
years/2024/src/day_14.rs
···
11
11
}
12
12
13
13
impl Day for Day14 {
14
14
-
day_stuff!(14, "", "", Vec<(Position, Position)>);
14
14
+
day_stuff!(14, "12", "", ((usize, usize), Vec<(Position, Position)>));
15
15
16
16
-
fn part_1(input: Self::Input) -> Option<String> {
17
17
-
let bounds = (101, 103);
16
16
+
fn part_1((bounds, input): Self::Input) -> Option<String> {
18
17
let times = 100;
19
18
let (ur, ul, ll, lr) = input
20
19
.into_iter()
···
46
45
Some((ur * ul * ll * lr).to_string())
47
46
}
48
47
49
49
-
fn part_2(input: Self::Input) -> Option<String> {
50
50
-
let bounds = (101, 103);
48
48
+
fn part_2((bounds, input): Self::Input) -> Option<String> {
49
49
+
let re = Regex::new(include_str!("da_tree.txt")).unwrap();
51
50
52
52
-
let re = Regex::new(include_str!("da_tree.txt")).unwrap();
51
51
+
if bounds != (101, 103) {
52
52
+
// Im to lazy to account for other sizes, womp womp.
53
53
+
return Some(String::new());
54
54
+
}
53
55
54
56
for i in 0..i32::MAX {
55
57
let bots = input
···
82
84
}
83
85
84
86
fn parse_input(input: &str) -> Self::Input {
85
85
-
input
86
86
-
.trim()
87
87
+
let (bounds, rest) = input.trim().split_once("\n\n").unwrap();
88
88
+
89
89
+
let mut bounds = bounds.split(',').map(|s| s.parse::<usize>().unwrap());
90
90
+
91
91
+
let (x, y) = (bounds.next().unwrap(), bounds.next().unwrap());
92
92
+
93
93
+
let input = rest
87
94
.lines()
88
95
.map(|l| {
89
96
let (pr, vr) = l.split_once(" ").unwrap();
···
104
111
105
112
(Position::new(p[0], p[1]), Position::new(v[0], v[1]))
106
113
})
107
107
-
.collect()
114
114
+
.collect();
115
115
+
116
116
+
((x, y), input)
108
117
}
109
118
}
+30
-27
years/2024/src/day_15.rs
···
111
111
.sum()
112
112
}
113
113
114
114
+
type Input = (Position, PosMap, Vec<Direction>);
115
115
+
116
116
+
fn actual_parse(input: &str) -> Input {
117
117
+
let (map, dirs) = input.trim().split_once("\n\n").unwrap();
118
118
+
let dirs = dirs
119
119
+
.split('\n')
120
120
+
.flat_map(|l| l.chars().map(parse_instruction))
121
121
+
.collect();
122
122
+
123
123
+
let grid = Grid::<Tile>::parse(map);
124
124
+
125
125
+
let robo = grid.find_tile(&Tile::Robot).unwrap();
126
126
+
127
127
+
let pos_map = grid.iter().map(|(pos, tile)| (pos, *tile)).collect();
128
128
+
129
129
+
(robo, pos_map, dirs)
130
130
+
}
131
131
+
132
132
+
fn actual_parse_part_2(input: &str) -> Input {
133
133
+
let replace = input.replace('#', "##");
134
134
+
let replace = replace.replace('.', "..");
135
135
+
let replace = replace.replace('O', "[]");
136
136
+
let replace = replace.replace('@', "@.");
137
137
+
actual_parse(&replace)
138
138
+
}
139
139
+
114
140
impl Day for Day15 {
115
115
-
day_stuff!(15, "", "", (Position, PosMap, Vec<Direction>));
141
141
+
day_stuff!(15, "10092", "9021");
116
142
117
143
fn part_1(input: Self::Input) -> Option<String> {
118
118
-
let (mut robo, mut pos_map, ins) = input;
144
144
+
let (mut robo, mut pos_map, ins) = actual_parse(&input);
119
145
for i in ins {
120
120
-
if let Some(new_pos) = movement(robo, i, dbg!(&mut pos_map)) {
146
146
+
if let Some(new_pos) = movement(robo, i, &mut pos_map) {
121
147
robo = new_pos;
122
148
}
123
149
}
···
125
151
}
126
152
127
153
fn part_2(input: Self::Input) -> Option<String> {
128
128
-
let (mut robo, mut pos_map, ins) = input;
154
154
+
let (mut robo, mut pos_map, ins) = actual_parse_part_2(&input);
129
155
for i in ins {
130
156
if let Some(new_pos) = movement_pt_2(robo, i, &mut pos_map) {
131
131
-
println!("Move success");
132
157
robo = new_pos;
133
158
}
134
159
}
135
160
Some(gps(&pos_map).to_string())
136
136
-
}
137
137
-
138
138
-
fn parse_input(input: &str) -> Self::Input {
139
139
-
// TODO: Temp for pt 2
140
140
-
let replace = input.replace('#', "##");
141
141
-
let replace = replace.replace('.', "..");
142
142
-
let replace = replace.replace('O', "[]");
143
143
-
let replace = replace.replace('@', "@.");
144
144
-
println!("{}", &replace);
145
145
-
let (map, dirs) = &replace.trim().split_once("\n\n").unwrap();
146
146
-
let dirs = dirs
147
147
-
.split('\n')
148
148
-
.flat_map(|l| l.chars().map(parse_instruction))
149
149
-
.collect();
150
150
-
151
151
-
let grid = Grid::<Tile>::parse(map);
152
152
-
153
153
-
let robo = grid.find_tile(&Tile::Robot).unwrap();
154
154
-
155
155
-
let pos_map = grid.iter().map(|(pos, tile)| (pos, *tile)).collect();
156
156
-
157
157
-
(robo, pos_map, dirs)
158
161
}
159
162
}
+1
-1
years/2024/src/day_16.rs
···
41
41
}
42
42
43
43
impl Day for Day16 {
44
44
-
day_stuff!(16, "", "", Grid);
44
44
+
day_stuff!(16, "11048", "64", Grid);
45
45
46
46
fn part_1(input: Self::Input) -> Option<String> {
47
47
let start_pos = input.find_tile(&Tile::Start).unwrap();
+1
-1
years/2024/src/day_17.rs
···
143
143
}
144
144
145
145
impl Day for Day17 {
146
146
-
day_stuff!(17, "", "", Computer);
146
146
+
day_stuff!(17, "4,6,3,5,6,3,5,2,1,0", "117440", Computer);
147
147
148
148
fn part_1(mut input: Self::Input) -> Option<String> {
149
149
let mut ip = 0;
+21
-15
years/2024/src/day_18.rs
···
4
4
};
5
5
6
6
use advent_core::{day_stuff, ex_for_day, Day};
7
7
-
use utils::{ipos, pos::Position, upos};
7
7
+
use utils::{pos::Position, upos};
8
8
9
9
pub struct Day18;
10
10
···
28
28
}
29
29
30
30
impl Day for Day18 {
31
31
-
day_stuff!(18, "", "", Vec<Position>);
31
31
+
day_stuff!(18, "22", "6,1", ((usize, usize), usize, Vec<Position>));
32
32
33
33
-
fn part_1(input: Self::Input) -> Option<String> {
33
33
+
fn part_1((bounds, fallen, input): Self::Input) -> Option<String> {
34
34
let start_pos = Position::zero();
35
35
-
let end_pos = ipos!(70, 70);
35
35
+
let end_pos = upos!(bounds.0 - 1, bounds.1 - 1);
36
36
37
37
let mut queue = BinaryHeap::new();
38
38
···
54
54
}
55
55
56
56
for (next_pos, _dir) in pos
57
57
-
.adjacents_checked((71, 71))
58
58
-
.filter(|(p, _)| input.iter().take(1024).all(|op| op != p))
57
57
+
.adjacents_checked(bounds)
58
58
+
.filter(|(p, _)| input.iter().take(fallen).all(|op| op != p))
59
59
{
60
60
let next_state = DState {
61
61
cost: cost + 1,
···
72
72
panic!("No Path")
73
73
}
74
74
75
75
-
fn part_2(input: Self::Input) -> Option<String> {
75
75
+
fn part_2((bounds, _, input): Self::Input) -> Option<String> {
76
76
for i in 0..input.len() {
77
77
-
println!("Byte {} of {}", i + 1, input.len());
78
77
let start_pos = Position::zero();
79
79
-
let end_pos = ipos!(70, 70);
78
78
+
let end_pos = upos!(bounds.0 - 1, bounds.1 - 1);
80
79
81
80
let mut queue = BinaryHeap::new();
82
81
···
100
99
}
101
100
102
101
for (next_pos, _dir) in pos
103
103
-
.adjacents_checked((71, 71))
102
102
+
.adjacents_checked(bounds)
104
103
.filter(|(p, _)| input.iter().take(i + 1).all(|op| op != p))
105
104
{
106
105
let next_state = DState {
···
115
114
}
116
115
}
117
116
if !flag {
118
118
-
return Some(input[i].to_string());
117
117
+
return Some(format!("{},{}", input[i].x, input[i].y));
119
118
}
120
119
}
121
121
-
None
120
120
+
panic!("All paths are possible!")
122
121
}
123
122
124
123
fn parse_input(input: &str) -> Self::Input {
125
125
-
input
126
126
-
.trim()
124
124
+
let (bounds, rest) = input.trim().split_once("\n\n").unwrap();
125
125
+
126
126
+
let mut extra = bounds.split(',').map(|s| s.parse::<usize>().unwrap());
127
127
+
let bounds = (extra.next().unwrap(), extra.next().unwrap());
128
128
+
let fallen = extra.next().unwrap();
129
129
+
130
130
+
let input = rest
127
131
.lines()
128
132
.map(|l| {
129
133
let (x, y) = l.split_once(',').unwrap();
130
134
upos!(x.parse::<usize>().unwrap(), y.parse::<usize>().unwrap())
131
135
})
132
132
-
.collect()
136
136
+
.collect();
137
137
+
138
138
+
(bounds, fallen, input)
133
139
}
134
140
}
+1
-1
years/2024/src/day_19.rs
···
5
5
pub struct Day19;
6
6
7
7
impl Day for Day19 {
8
8
-
day_stuff!(19, "", "", (HashSet<String>, Vec<String>));
8
8
+
day_stuff!(19, "6", "16", (HashSet<String>, Vec<String>));
9
9
10
10
fn part_1(input: Self::Input) -> Option<String> {
11
11
let (avail, desire) = input;
+2
-5
years/2024/src/day_20.rs
···
15
15
type Grid = utils::grid::Grid<Tile>;
16
16
17
17
impl Day for Day20 {
18
18
-
day_stuff!(20, "", "", Grid);
18
18
+
// Technically it's correct :)
19
19
+
day_stuff!(20, "0", "0", Grid);
19
20
20
21
fn part_1(input: Self::Input) -> Option<String> {
21
22
let end_pos = input.find_tile(&Tile::End).unwrap();
···
50
51
51
52
let ans = cheat_set.values().filter(|c| **c >= 100).count();
52
53
53
53
-
dbg!(cheat_set.len());
54
54
-
55
54
Some(ans.to_string())
56
55
}
57
56
···
87
86
}
88
87
89
88
let ans = cheat_set.values().filter(|c| **c >= 100).count();
90
90
-
91
91
-
dbg!(cheat_set.len());
92
89
93
90
Some(ans.to_string())
94
91
}
+1
-1
years/2024/src/day_21.rs
···
106
106
}
107
107
108
108
impl Day for Day21 {
109
109
-
day_stuff!(21, "", "", Vec<(usize, Vec<char>)>);
109
109
+
day_stuff!(21, "126384", "154115708116294", Vec<(usize, Vec<char>)>);
110
110
111
111
fn part_1(input: Self::Input) -> Option<String> {
112
112
let (num_grid, dir_grid) = pad_grids();
+1
-1
years/2024/src/day_22.rs
···
43
43
}
44
44
45
45
impl Day for Day22 {
46
46
-
day_stuff!(22, "", "", Vec<usize>);
46
46
+
day_stuff!(22, "37327623", "23", Vec<usize>);
47
47
48
48
fn part_1(input: Self::Input) -> Option<String> {
49
49
let ans = input
+1
-1
years/2024/src/day_23.rs
···
56
56
}
57
57
58
58
impl Day for Day23 {
59
59
-
day_stuff!(23, "", "", Edges);
59
59
+
day_stuff!(23, "7", "co,de,ka,ta", Edges);
60
60
61
61
fn part_1(input: Self::Input) -> Option<String> {
62
62
let groups = input
+2
-1
years/2024/src/day_24.rs
···
203
203
// z16,tdv,hnd,z09,z23,bks,nrn,tjp
204
204
205
205
impl Day for Day24 {
206
206
-
day_stuff!(24, "", "", (Wires, Gates));
206
206
+
day_stuff!(24, "4", "bks,hnd,nrn,tdv,tjp,z09,z16,z23", (Wires, Gates));
207
207
208
208
fn part_1((mut wires, gates): Self::Input) -> Option<String> {
209
209
let mut all_zs = gates
···
212
212
.map(|g| &g.target)
213
213
.collect::<Vec<_>>();
214
214
all_zs.sort();
215
215
+
all_zs.dedup();
215
216
216
217
let mut current_zs = HashSet::<&String>::with_capacity(all_zs.len());
217
218
+1
-1
years/2024/src/day_25.rs
···
13
13
type Grid = utils::grid::Grid<Tile>;
14
14
15
15
impl Day for Day25 {
16
16
-
day_stuff!(25, "", "", (HashSet<[u8; 5]>, HashSet<[u8; 5]>));
16
16
+
day_stuff!(25, "3", "🥳", (HashSet<[u8; 5]>, HashSet<[u8; 5]>));
17
17
18
18
fn part_1((locks, keys): Self::Input) -> Option<String> {
19
19
let ans = locks
+10
years/2024/src/examples/day_12/1.txt
···
1
1
+
RRRRIICCFF
2
2
+
RRRRIICCCF
3
3
+
VVRRRCCFFF
4
4
+
VVRCCCJFFF
5
5
+
VVVVCJJCFE
6
6
+
VVIVCCJJEE
7
7
+
VVIIICJJEE
8
8
+
MIIIIIJJEE
9
9
+
MIIISIJEEE
10
10
+
MMMISSJEEE
+10
years/2024/src/examples/day_12/2.txt
···
1
1
+
RRRRIICCFF
2
2
+
RRRRIICCCF
3
3
+
VVRRRCCFFF
4
4
+
VVRCCCJFFF
5
5
+
VVVVCJJCFE
6
6
+
VVIVCCJJEE
7
7
+
VVIIICJJEE
8
8
+
MIIIIIJJEE
9
9
+
MIIISIJEEE
10
10
+
MMMISSJEEE
+15
years/2024/src/examples/day_13/1.txt
···
1
1
+
Button A: X+94, Y+34
2
2
+
Button B: X+22, Y+67
3
3
+
Prize: X=8400, Y=5400
4
4
+
5
5
+
Button A: X+26, Y+66
6
6
+
Button B: X+67, Y+21
7
7
+
Prize: X=12748, Y=12176
8
8
+
9
9
+
Button A: X+17, Y+86
10
10
+
Button B: X+84, Y+37
11
11
+
Prize: X=7870, Y=6450
12
12
+
13
13
+
Button A: X+69, Y+23
14
14
+
Button B: X+27, Y+71
15
15
+
Prize: X=18641, Y=10279
+15
years/2024/src/examples/day_13/2.txt
···
1
1
+
Button A: X+94, Y+34
2
2
+
Button B: X+22, Y+67
3
3
+
Prize: X=8400, Y=5400
4
4
+
5
5
+
Button A: X+26, Y+66
6
6
+
Button B: X+67, Y+21
7
7
+
Prize: X=12748, Y=12176
8
8
+
9
9
+
Button A: X+17, Y+86
10
10
+
Button B: X+84, Y+37
11
11
+
Prize: X=7870, Y=6450
12
12
+
13
13
+
Button A: X+69, Y+23
14
14
+
Button B: X+27, Y+71
15
15
+
Prize: X=18641, Y=10279
+14
years/2024/src/examples/day_14/1.txt
···
1
1
+
11,7
2
2
+
3
3
+
p=0,4 v=3,-3
4
4
+
p=6,3 v=-1,-3
5
5
+
p=10,3 v=-1,2
6
6
+
p=2,0 v=2,-1
7
7
+
p=0,0 v=1,3
8
8
+
p=3,0 v=-2,-2
9
9
+
p=7,6 v=-1,-3
10
10
+
p=3,0 v=-1,-2
11
11
+
p=9,3 v=2,3
12
12
+
p=7,3 v=-1,2
13
13
+
p=2,4 v=2,-3
14
14
+
p=9,5 v=-3,-3
+14
years/2024/src/examples/day_14/2.txt
···
1
1
+
11,7
2
2
+
3
3
+
p=0,4 v=3,-3
4
4
+
p=6,3 v=-1,-3
5
5
+
p=10,3 v=-1,2
6
6
+
p=2,0 v=2,-1
7
7
+
p=0,0 v=1,3
8
8
+
p=3,0 v=-2,-2
9
9
+
p=7,6 v=-1,-3
10
10
+
p=3,0 v=-1,-2
11
11
+
p=9,3 v=2,3
12
12
+
p=7,3 v=-1,2
13
13
+
p=2,4 v=2,-3
14
14
+
p=9,5 v=-3,-3
+21
years/2024/src/examples/day_15/1.txt
···
1
1
+
##########
2
2
+
#..O..O.O#
3
3
+
#......O.#
4
4
+
#.OO..O.O#
5
5
+
#..O@..O.#
6
6
+
#O#..O...#
7
7
+
#O..O..O.#
8
8
+
#.OO.O.OO#
9
9
+
#....O...#
10
10
+
##########
11
11
+
12
12
+
<vv>^<v^>v>^vv^v>v<>v^v<v<^vv<<<^><<><>>v<vvv<>^v^>^<<<><<v<<<v^vv^v>^
13
13
+
vvv<<^>^v^^><<>>><>^<<><^vv^^<>vvv<>><^^v>^>vv<>v<<<<v<^v>^<^^>>>^<v<v
14
14
+
><>vv>v^v^<>><>>>><^^>vv>v<^^^>>v^v^<^^>v^^>v^<^v>v<>>v^v^<v>v^^<^^vv<
15
15
+
<<v<^>>^^^^>>>v^<>vvv^><v<<<>^^^vv^<vvv>^>v<^^^^v<>^>vvvv><>>v^<<^^^^^
16
16
+
^><^><>>><>^^<<^^v>>><^<v>^<vv>>v>>>^v><>^v><<<<v>>v<v<v>vvv>^<><<>^><
17
17
+
^>><>^v<><^vvv<^^<><v<<<<<><^v<<<><<<^^<v<^^^><^>>^<v^><<<^>>^v<v^v<v^
18
18
+
>^>>^v>vv>^<<^v<>><<><<v<<v><>v<^vv<<<>^^v^>^^>>><<^v>>v^v><^^>>^<>vv^
19
19
+
<><^^>^^^<><vvvvv^v<v<<>^v<v>v<<^><<><<><<<^^<<<^<<>><<><^^^>^^<>^>v<>
20
20
+
^^>vv<^v^v<vv>^<><v<^v>^^^>>>^^vvv^>vvv<>>>^<^>>>>>^<<^v>^vvv<>^<><<v>
21
21
+
v^^>>><<^^<>>^v^<v^vv<>v^<<>^<^v^v><^<<<><<^<v><v<>vv>>v><v^<vv<>v^<<^
+21
years/2024/src/examples/day_15/2.txt
···
1
1
+
##########
2
2
+
#..O..O.O#
3
3
+
#......O.#
4
4
+
#.OO..O.O#
5
5
+
#..O@..O.#
6
6
+
#O#..O...#
7
7
+
#O..O..O.#
8
8
+
#.OO.O.OO#
9
9
+
#....O...#
10
10
+
##########
11
11
+
12
12
+
<vv>^<v^>v>^vv^v>v<>v^v<v<^vv<<<^><<><>>v<vvv<>^v^>^<<<><<v<<<v^vv^v>^
13
13
+
vvv<<^>^v^^><<>>><>^<<><^vv^^<>vvv<>><^^v>^>vv<>v<<<<v<^v>^<^^>>>^<v<v
14
14
+
><>vv>v^v^<>><>>>><^^>vv>v<^^^>>v^v^<^^>v^^>v^<^v>v<>>v^v^<v>v^^<^^vv<
15
15
+
<<v<^>>^^^^>>>v^<>vvv^><v<<<>^^^vv^<vvv>^>v<^^^^v<>^>vvvv><>>v^<<^^^^^
16
16
+
^><^><>>><>^^<<^^v>>><^<v>^<vv>>v>>>^v><>^v><<<<v>>v<v<v>vvv>^<><<>^><
17
17
+
^>><>^v<><^vvv<^^<><v<<<<<><^v<<<><<<^^<v<^^^><^>>^<v^><<<^>>^v<v^v<v^
18
18
+
>^>>^v>vv>^<<^v<>><<><<v<<v><>v<^vv<<<>^^v^>^^>>><<^v>>v^v><^^>>^<>vv^
19
19
+
<><^^>^^^<><vvvvv^v<v<<>^v<v>v<<^><<><<><<<^^<<<^<<>><<><^^^>^^<>^>v<>
20
20
+
^^>vv<^v^v<vv>^<><v<^v>^^^>>>^^vvv^>vvv<>>>^<^>>>>>^<<^v>^vvv<>^<><<v>
21
21
+
v^^>>><<^^<>>^v^<v^vv<>v^<<>^<^v^v><^<<<><<^<v><v<>vv>>v><v^<vv<>v^<<^
+17
years/2024/src/examples/day_16/1.txt
···
1
1
+
#################
2
2
+
#...#...#...#..E#
3
3
+
#.#.#.#.#.#.#.#.#
4
4
+
#.#.#.#...#...#.#
5
5
+
#.#.#.#.###.#.#.#
6
6
+
#...#.#.#.....#.#
7
7
+
#.#.#.#.#.#####.#
8
8
+
#.#...#.#.#.....#
9
9
+
#.#.#####.#.###.#
10
10
+
#.#.#.......#...#
11
11
+
#.#.###.#####.###
12
12
+
#.#.#...#.....#.#
13
13
+
#.#.#.#####.###.#
14
14
+
#.#.#.........#.#
15
15
+
#.#.#.#########.#
16
16
+
#S#.............#
17
17
+
#################
+17
years/2024/src/examples/day_16/2.txt
···
1
1
+
#################
2
2
+
#...#...#...#..E#
3
3
+
#.#.#.#.#.#.#.#.#
4
4
+
#.#.#.#...#...#.#
5
5
+
#.#.#.#.###.#.#.#
6
6
+
#...#.#.#.....#.#
7
7
+
#.#.#.#.#.#####.#
8
8
+
#.#...#.#.#.....#
9
9
+
#.#.#####.#.###.#
10
10
+
#.#.#.......#...#
11
11
+
#.#.###.#####.###
12
12
+
#.#.#...#.....#.#
13
13
+
#.#.#.#####.###.#
14
14
+
#.#.#.........#.#
15
15
+
#.#.#.#########.#
16
16
+
#S#.............#
17
17
+
#################
+5
years/2024/src/examples/day_17/1.txt
···
1
1
+
Register A: 729
2
2
+
Register B: 0
3
3
+
Register C: 0
4
4
+
5
5
+
Program: 0,1,5,4,3,0
+5
years/2024/src/examples/day_17/2.txt
···
1
1
+
Register A: 2024
2
2
+
Register B: 0
3
3
+
Register C: 0
4
4
+
5
5
+
Program: 0,3,5,4,3,0
+27
years/2024/src/examples/day_18/1.txt
···
1
1
+
7,7,12
2
2
+
3
3
+
5,4
4
4
+
4,2
5
5
+
4,5
6
6
+
3,0
7
7
+
2,1
8
8
+
6,3
9
9
+
2,4
10
10
+
1,5
11
11
+
0,6
12
12
+
3,3
13
13
+
2,6
14
14
+
5,1
15
15
+
1,2
16
16
+
5,5
17
17
+
2,5
18
18
+
6,5
19
19
+
1,4
20
20
+
0,4
21
21
+
6,4
22
22
+
1,1
23
23
+
6,1
24
24
+
1,0
25
25
+
0,5
26
26
+
1,6
27
27
+
2,0
+27
years/2024/src/examples/day_18/2.txt
···
1
1
+
7,7,12
2
2
+
3
3
+
5,4
4
4
+
4,2
5
5
+
4,5
6
6
+
3,0
7
7
+
2,1
8
8
+
6,3
9
9
+
2,4
10
10
+
1,5
11
11
+
0,6
12
12
+
3,3
13
13
+
2,6
14
14
+
5,1
15
15
+
1,2
16
16
+
5,5
17
17
+
2,5
18
18
+
6,5
19
19
+
1,4
20
20
+
0,4
21
21
+
6,4
22
22
+
1,1
23
23
+
6,1
24
24
+
1,0
25
25
+
0,5
26
26
+
1,6
27
27
+
2,0
+10
years/2024/src/examples/day_19/1.txt
···
1
1
+
r, wr, b, g, bwu, rb, gb, br
2
2
+
3
3
+
brwrr
4
4
+
bggr
5
5
+
gbbr
6
6
+
rrbgbr
7
7
+
ubwu
8
8
+
bwurrg
9
9
+
brgr
10
10
+
bbrgwb
+10
years/2024/src/examples/day_19/2.txt
···
1
1
+
r, wr, b, g, bwu, rb, gb, br
2
2
+
3
3
+
brwrr
4
4
+
bggr
5
5
+
gbbr
6
6
+
rrbgbr
7
7
+
ubwu
8
8
+
bwurrg
9
9
+
brgr
10
10
+
bbrgwb
+15
years/2024/src/examples/day_20/1.txt
···
1
1
+
###############
2
2
+
#...#...#.....#
3
3
+
#.#.#.#.#.###.#
4
4
+
#S#...#.#.#...#
5
5
+
#######.#.#.###
6
6
+
#######.#.#...#
7
7
+
#######.#.###.#
8
8
+
###..E#...#...#
9
9
+
###.#######.###
10
10
+
#...###...#...#
11
11
+
#.#####.#.###.#
12
12
+
#.#...#.#.#...#
13
13
+
#.#.#.#.#.#.###
14
14
+
#...#...#...###
15
15
+
###############
+15
years/2024/src/examples/day_20/2.txt
···
1
1
+
###############
2
2
+
#...#...#.....#
3
3
+
#.#.#.#.#.###.#
4
4
+
#S#...#.#.#...#
5
5
+
#######.#.#.###
6
6
+
#######.#.#...#
7
7
+
#######.#.###.#
8
8
+
###..E#...#...#
9
9
+
###.#######.###
10
10
+
#...###...#...#
11
11
+
#.#####.#.###.#
12
12
+
#.#...#.#.#...#
13
13
+
#.#.#.#.#.#.###
14
14
+
#...#...#...###
15
15
+
###############
+5
years/2024/src/examples/day_21/1.txt
···
1
1
+
029A
2
2
+
980A
3
3
+
179A
4
4
+
456A
5
5
+
379A
+5
years/2024/src/examples/day_21/2.txt
···
1
1
+
029A
2
2
+
980A
3
3
+
179A
4
4
+
456A
5
5
+
379A
+4
years/2024/src/examples/day_22/1.txt
···
1
1
+
1
2
2
+
10
3
3
+
100
4
4
+
2024
+4
years/2024/src/examples/day_22/2.txt
···
1
1
+
1
2
2
+
2
3
3
+
3
4
4
+
2024
+32
years/2024/src/examples/day_23/1.txt
···
1
1
+
kh-tc
2
2
+
qp-kh
3
3
+
de-cg
4
4
+
ka-co
5
5
+
yn-aq
6
6
+
qp-ub
7
7
+
cg-tb
8
8
+
vc-aq
9
9
+
tb-ka
10
10
+
wh-tc
11
11
+
yn-cg
12
12
+
kh-ub
13
13
+
ta-co
14
14
+
de-co
15
15
+
tc-td
16
16
+
tb-wq
17
17
+
wh-td
18
18
+
ta-ka
19
19
+
td-qp
20
20
+
aq-cg
21
21
+
wq-ub
22
22
+
ub-vc
23
23
+
de-ta
24
24
+
wq-aq
25
25
+
wq-vc
26
26
+
wh-yn
27
27
+
ka-de
28
28
+
kh-ta
29
29
+
co-tc
30
30
+
wh-qp
31
31
+
tb-vc
32
32
+
td-yn
+32
years/2024/src/examples/day_23/2.txt
···
1
1
+
kh-tc
2
2
+
qp-kh
3
3
+
de-cg
4
4
+
ka-co
5
5
+
yn-aq
6
6
+
qp-ub
7
7
+
cg-tb
8
8
+
vc-aq
9
9
+
tb-ka
10
10
+
wh-tc
11
11
+
yn-cg
12
12
+
kh-ub
13
13
+
ta-co
14
14
+
de-co
15
15
+
tc-td
16
16
+
tb-wq
17
17
+
wh-td
18
18
+
ta-ka
19
19
+
td-qp
20
20
+
aq-cg
21
21
+
wq-ub
22
22
+
ub-vc
23
23
+
de-ta
24
24
+
wq-aq
25
25
+
wq-vc
26
26
+
wh-yn
27
27
+
ka-de
28
28
+
kh-ta
29
29
+
co-tc
30
30
+
wh-qp
31
31
+
tb-vc
32
32
+
td-yn
+10
years/2024/src/examples/day_24/1.txt
···
1
1
+
x00: 1
2
2
+
x01: 1
3
3
+
x02: 1
4
4
+
y00: 0
5
5
+
y01: 1
6
6
+
y02: 0
7
7
+
8
8
+
x00 AND y00 -> z00
9
9
+
x01 XOR y01 -> z01
10
10
+
x02 OR y02 -> z02
+313
years/2024/src/examples/day_24/2.txt
···
1
1
+
x00: 1
2
2
+
x01: 0
3
3
+
x02: 1
4
4
+
x03: 1
5
5
+
x04: 0
6
6
+
x05: 0
7
7
+
x06: 1
8
8
+
x07: 1
9
9
+
x08: 0
10
10
+
x09: 1
11
11
+
x10: 1
12
12
+
x11: 1
13
13
+
x12: 1
14
14
+
x13: 0
15
15
+
x14: 0
16
16
+
x15: 1
17
17
+
x16: 1
18
18
+
x17: 1
19
19
+
x18: 0
20
20
+
x19: 1
21
21
+
x20: 1
22
22
+
x21: 0
23
23
+
x22: 1
24
24
+
x23: 1
25
25
+
x24: 1
26
26
+
x25: 1
27
27
+
x26: 1
28
28
+
x27: 0
29
29
+
x28: 0
30
30
+
x29: 1
31
31
+
x30: 0
32
32
+
x31: 0
33
33
+
x32: 1
34
34
+
x33: 1
35
35
+
x34: 1
36
36
+
x35: 1
37
37
+
x36: 0
38
38
+
x37: 1
39
39
+
x38: 0
40
40
+
x39: 0
41
41
+
x40: 1
42
42
+
x41: 1
43
43
+
x42: 1
44
44
+
x43: 0
45
45
+
x44: 1
46
46
+
y00: 1
47
47
+
y01: 0
48
48
+
y02: 0
49
49
+
y03: 1
50
50
+
y04: 1
51
51
+
y05: 0
52
52
+
y06: 0
53
53
+
y07: 0
54
54
+
y08: 0
55
55
+
y09: 0
56
56
+
y10: 0
57
57
+
y11: 1
58
58
+
y12: 0
59
59
+
y13: 1
60
60
+
y14: 1
61
61
+
y15: 0
62
62
+
y16: 0
63
63
+
y17: 0
64
64
+
y18: 0
65
65
+
y19: 1
66
66
+
y20: 0
67
67
+
y21: 0
68
68
+
y22: 0
69
69
+
y23: 0
70
70
+
y24: 0
71
71
+
y25: 0
72
72
+
y26: 0
73
73
+
y27: 0
74
74
+
y28: 1
75
75
+
y29: 1
76
76
+
y30: 0
77
77
+
y31: 0
78
78
+
y32: 1
79
79
+
y33: 0
80
80
+
y34: 0
81
81
+
y35: 0
82
82
+
y36: 1
83
83
+
y37: 0
84
84
+
y38: 0
85
85
+
y39: 0
86
86
+
y40: 1
87
87
+
y41: 0
88
88
+
y42: 0
89
89
+
y43: 1
90
90
+
y44: 1
91
91
+
92
92
+
y40 AND x40 -> wdr
93
93
+
kpc OR jsd -> chv
94
94
+
jwm AND nbr -> pbb
95
95
+
mrn XOR mck -> z31
96
96
+
x37 AND y37 -> tjp
97
97
+
x13 XOR y13 -> jdm
98
98
+
nfw OR bbc -> wkc
99
99
+
y02 AND x02 -> qff
100
100
+
tdg XOR sjk -> z35
101
101
+
pjv AND fnq -> hrr
102
102
+
x36 AND y36 -> mdk
103
103
+
bnf OR vcn -> kbg
104
104
+
rfk AND qcq -> mnr
105
105
+
x38 XOR y38 -> bbq
106
106
+
ghr XOR tjp -> z37
107
107
+
x40 XOR y40 -> vtq
108
108
+
x39 XOR y39 -> drm
109
109
+
bcj OR qff -> jwm
110
110
+
y25 XOR x25 -> fnq
111
111
+
jdm AND wkc -> nrm
112
112
+
y30 XOR x30 -> wpg
113
113
+
mmp OR tjk -> rbc
114
114
+
x17 AND y17 -> dbh
115
115
+
x06 XOR y06 -> pgb
116
116
+
wpg AND jtf -> sqj
117
117
+
bgs AND rbc -> bvb
118
118
+
jdq AND gqw -> qbq
119
119
+
rqf XOR rjt -> z02
120
120
+
mdk OR cbd -> ghr
121
121
+
y32 XOR x32 -> hvk
122
122
+
psj XOR jfw -> z21
123
123
+
x36 XOR y36 -> wvp
124
124
+
wvd OR dgc -> fqf
125
125
+
dds XOR kmh -> z33
126
126
+
sfv AND rdb -> qmq
127
127
+
mvk XOR gkm -> z04
128
128
+
y22 XOR x22 -> wkb
129
129
+
wwg XOR bbp -> hnd
130
130
+
djv OR mqd -> fgt
131
131
+
wkb XOR nfn -> z22
132
132
+
bkn OR ssg -> gng
133
133
+
nfn AND wkb -> tgj
134
134
+
y41 AND x41 -> wvd
135
135
+
qtk OR jnq -> wwg
136
136
+
x21 AND y21 -> jpq
137
137
+
kjb XOR bcm -> z34
138
138
+
x28 AND y28 -> drt
139
139
+
cqk XOR hns -> z15
140
140
+
x10 AND y10 -> ksw
141
141
+
dch AND tsc -> fkr
142
142
+
x44 XOR y44 -> nct
143
143
+
y20 XOR x20 -> bgs
144
144
+
ggh AND bbq -> bkn
145
145
+
pgb AND jbb -> kth
146
146
+
x01 AND y01 -> vqv
147
147
+
jfs AND wsb -> dqt
148
148
+
twn OR tkb -> jkw
149
149
+
y18 AND x18 -> smg
150
150
+
ttm OR tcv -> jtf
151
151
+
mfr XOR scw -> bks
152
152
+
x00 AND y00 -> jfs
153
153
+
bns AND qjr -> tgq
154
154
+
y03 XOR x03 -> nbr
155
155
+
ggh XOR bbq -> z38
156
156
+
y43 XOR x43 -> rdb
157
157
+
qht XOR kbg -> z08
158
158
+
jtf XOR wpg -> z30
159
159
+
bgf AND fqf -> fpf
160
160
+
gng XOR drm -> z39
161
161
+
y09 XOR x09 -> bbp
162
162
+
hmv OR fpf -> sfv
163
163
+
kjb AND bcm -> kbp
164
164
+
x15 XOR y15 -> hns
165
165
+
x35 XOR y35 -> sjk
166
166
+
bns XOR qjr -> z14
167
167
+
hfw OR pjj -> dds
168
168
+
qbq OR krf -> jbb
169
169
+
vtq AND dpf -> cvp
170
170
+
x21 XOR y21 -> jfw
171
171
+
rfk XOR qcq -> z18
172
172
+
y02 XOR x02 -> rjt
173
173
+
wvp XOR rdh -> z36
174
174
+
y39 AND x39 -> wjk
175
175
+
njw OR bvb -> psj
176
176
+
y09 AND x09 -> rbr
177
177
+
qdp AND kcs -> bnf
178
178
+
qmq OR spr -> cvc
179
179
+
x33 AND y33 -> rdv
180
180
+
sjk AND tdg -> ctf
181
181
+
y31 XOR x31 -> mck
182
182
+
hbj XOR jdn -> z27
183
183
+
vhf AND tdv -> vdn
184
184
+
x19 AND y19 -> tjk
185
185
+
y07 XOR x07 -> kcs
186
186
+
y07 AND x07 -> vcn
187
187
+
y34 XOR x34 -> kjb
188
188
+
y08 XOR x08 -> qht
189
189
+
hbc OR kdq -> jdq
190
190
+
bbp AND wwg -> z09
191
191
+
x15 AND y15 -> twn
192
192
+
fdp AND shq -> ttm
193
193
+
y29 AND x29 -> tcv
194
194
+
x33 XOR y33 -> kmh
195
195
+
brw AND rnw -> dgc
196
196
+
x16 AND y16 -> pwk
197
197
+
nvh OR vdt -> vdm
198
198
+
rkp OR tgj -> scw
199
199
+
fmr OR sjh -> z45
200
200
+
scw AND mfr -> qhm
201
201
+
rdv OR dhg -> bcm
202
202
+
x04 XOR y04 -> mvk
203
203
+
x44 AND y44 -> fmr
204
204
+
y32 AND x32 -> pjj
205
205
+
kmf XOR mss -> z10
206
206
+
y38 AND x38 -> ssg
207
207
+
x22 AND y22 -> rkp
208
208
+
rqf AND rjt -> bcj
209
209
+
rbc XOR bgs -> z20
210
210
+
y29 XOR x29 -> shq
211
211
+
gbc OR wjk -> dpf
212
212
+
sqj OR bnd -> mrn
213
213
+
x13 AND y13 -> bhn
214
214
+
tdv XOR vhf -> z17
215
215
+
x00 XOR y00 -> z00
216
216
+
y28 XOR x28 -> nfk
217
217
+
kgv XOR wrk -> z26
218
218
+
x11 AND y11 -> jsd
219
219
+
cmm OR wkm -> jdn
220
220
+
x10 XOR y10 -> mss
221
221
+
rbr OR hnd -> kmf
222
222
+
wdr OR cvp -> rnw
223
223
+
y42 XOR x42 -> bgf
224
224
+
brw XOR rnw -> z41
225
225
+
x06 AND y06 -> ndm
226
226
+
y34 AND x34 -> tfn
227
227
+
y25 AND x25 -> dbm
228
228
+
y43 AND x43 -> spr
229
229
+
y23 XOR x23 -> mfr
230
230
+
rdb XOR sfv -> z43
231
231
+
ncj OR pwk -> z16
232
232
+
gcp OR fkr -> pjv
233
233
+
y11 XOR x11 -> rcr
234
234
+
jdm XOR wkc -> z13
235
235
+
y30 AND x30 -> bnd
236
236
+
jkw XOR mqf -> tdv
237
237
+
rcr AND cpj -> kpc
238
238
+
dpf XOR vtq -> z40
239
239
+
x08 AND y08 -> jnq
240
240
+
chv AND dpg -> nfw
241
241
+
y04 AND x04 -> kdq
242
242
+
vdm XOR nfk -> z28
243
243
+
y01 XOR x01 -> wsb
244
244
+
mss AND kmf -> hhm
245
245
+
fgt AND hvk -> hfw
246
246
+
hvk XOR fgt -> z32
247
247
+
x27 XOR y27 -> hbj
248
248
+
gqw XOR jdq -> z05
249
249
+
x12 XOR y12 -> dpg
250
250
+
fnq XOR pjv -> z25
251
251
+
drt OR mdh -> fdp
252
252
+
tjp AND ghr -> kpb
253
253
+
qhm OR bks -> dch
254
254
+
jbb XOR pgb -> z06
255
255
+
x16 XOR y16 -> mqf
256
256
+
psj AND jfw -> ffm
257
257
+
nfk AND vdm -> mdh
258
258
+
y26 XOR x26 -> wrk
259
259
+
mnr OR smg -> gbr
260
260
+
gkm AND mvk -> hbc
261
261
+
x31 AND y31 -> mqd
262
262
+
x12 AND y12 -> bbc
263
263
+
jfs XOR wsb -> z01
264
264
+
x23 AND y23 -> z23
265
265
+
y41 XOR x41 -> brw
266
266
+
hbj AND jdn -> nvh
267
267
+
tfn OR kbp -> tdg
268
268
+
dpg XOR chv -> z12
269
269
+
y17 XOR x17 -> vhf
270
270
+
fdp XOR shq -> z29
271
271
+
nct XOR cvc -> z44
272
272
+
bgf XOR fqf -> z42
273
273
+
x19 XOR y19 -> fff
274
274
+
x35 AND y35 -> ddp
275
275
+
x20 AND y20 -> njw
276
276
+
mck AND mrn -> djv
277
277
+
cpj XOR rcr -> z11
278
278
+
nbr XOR jwm -> z03
279
279
+
tsc XOR dch -> z24
280
280
+
x27 AND y27 -> vdt
281
281
+
cqk AND hns -> tkb
282
282
+
vdn OR dbh -> qcq
283
283
+
ffm OR jpq -> nfn
284
284
+
y14 XOR x14 -> bns
285
285
+
bhn OR nrm -> qjr
286
286
+
y03 AND x03 -> qvr
287
287
+
fff XOR gbr -> z19
288
288
+
qdp XOR kcs -> z07
289
289
+
x37 XOR y37 -> nrn
290
290
+
fqv OR tgq -> cqk
291
291
+
ctf OR ddp -> rdh
292
292
+
kgv AND wrk -> cmm
293
293
+
drm AND gng -> gbc
294
294
+
dbm OR hrr -> kgv
295
295
+
rdh AND wvp -> cbd
296
296
+
vqv OR dqt -> rqf
297
297
+
cvc AND nct -> sjh
298
298
+
y42 AND x42 -> hmv
299
299
+
hhm OR ksw -> cpj
300
300
+
y05 XOR x05 -> gqw
301
301
+
x05 AND y05 -> krf
302
302
+
mqf AND jkw -> ncj
303
303
+
x18 XOR y18 -> rfk
304
304
+
y14 AND x14 -> fqv
305
305
+
kpb OR nrn -> ggh
306
306
+
kbg AND qht -> qtk
307
307
+
pbb OR qvr -> gkm
308
308
+
x24 AND y24 -> gcp
309
309
+
y24 XOR x24 -> tsc
310
310
+
kth OR ndm -> qdp
311
311
+
gbr AND fff -> mmp
312
312
+
dds AND kmh -> dhg
313
313
+
x26 AND y26 -> wkm
+39
years/2024/src/examples/day_25/1.txt
···
1
1
+
#####
2
2
+
.####
3
3
+
.####
4
4
+
.####
5
5
+
.#.#.
6
6
+
.#...
7
7
+
.....
8
8
+
9
9
+
#####
10
10
+
##.##
11
11
+
.#.##
12
12
+
...##
13
13
+
...#.
14
14
+
...#.
15
15
+
.....
16
16
+
17
17
+
.....
18
18
+
#....
19
19
+
#....
20
20
+
#...#
21
21
+
#.#.#
22
22
+
#.###
23
23
+
#####
24
24
+
25
25
+
.....
26
26
+
.....
27
27
+
#.#..
28
28
+
###..
29
29
+
###.#
30
30
+
###.#
31
31
+
#####
32
32
+
33
33
+
.....
34
34
+
.....
35
35
+
.....
36
36
+
#....
37
37
+
#.#..
38
38
+
#.#.#
39
39
+
#####
+39
years/2024/src/examples/day_25/2.txt
···
1
1
+
#####
2
2
+
.####
3
3
+
.####
4
4
+
.####
5
5
+
.#.#.
6
6
+
.#...
7
7
+
.....
8
8
+
9
9
+
#####
10
10
+
##.##
11
11
+
.#.##
12
12
+
...##
13
13
+
...#.
14
14
+
...#.
15
15
+
.....
16
16
+
17
17
+
.....
18
18
+
#....
19
19
+
#....
20
20
+
#...#
21
21
+
#.#.#
22
22
+
#.###
23
23
+
#####
24
24
+
25
25
+
.....
26
26
+
.....
27
27
+
#.#..
28
28
+
###..
29
29
+
###.#
30
30
+
###.#
31
31
+
#####
32
32
+
33
33
+
.....
34
34
+
.....
35
35
+
.....
36
36
+
#....
37
37
+
#.#..
38
38
+
#.#.#
39
39
+
#####