Skip to content

Commit 05e28ca

Browse files
committed
Added day25 part 1
1 parent b133b3c commit 05e28ca

File tree

7 files changed

+1286
-4
lines changed

7 files changed

+1286
-4
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
// project meta data
66
group 'de.havox_design.aoc2023'
7-
version '0.24.2'
7+
version '0.24.3'
88

99
// Switch to gradle "all" distribution.
1010
wrapper {

day25/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Day 25: Snowverload
2+
Still somehow without snow, you go to the last place you haven't checked: the center of Snow Island, directly below the
3+
waterfall.
4+
5+
Here, someone has clearly been trying to fix the problem. Scattered everywhere are hundreds of weather machines,
6+
almanacs, communication modules, hoof prints, machine parts, mirrors, lenses, and so on.
7+
8+
Somehow, everything has been **wired together** into a massive snow-producing apparatus, but nothing seems to be
9+
running. You check a tiny screen on one of the communication modules: `Error 2023`. It doesn't say what `Error 2023`
10+
means, but it **does** have the phone number for a support line printed on it.
11+
12+
"Hi, you've reached Weather Machines And So On, Inc. How can I help you?" You explain the situation.
13+
14+
"Error 2023, you say? Why, that's a power overload error, of course! It means you have too many components plugged in.
15+
Try unplugging some components and--" You explain that there are hundreds of components here and you're in a bit of a
16+
hurry.
17+
18+
"Well, let's see how bad it is; do you see a **big red reset button** somewhere? It should be on its own module. If you
19+
push it, it probably won't fix anything, but it'll report how overloaded things are." After a minute or two, you find
20+
the reset button; it's so big that it takes two hands just to get enough leverage to push it. Its screen then displays:
21+
```
22+
SYSTEM OVERLOAD!
23+
24+
Connected components would require
25+
power equal to at least 100 stars!
26+
```
27+
"Wait, **how** many components did you say are plugged in? With that much equipment, you could produce snow for an
28+
**entire**--" You disconnect the call.
29+
30+
You have nowhere near that many stars - you need to find a way to disconnect at least half of the equipment here, but
31+
it's already Christmas! You only have time to disconnect **three wires**.
32+
33+
Fortunately, someone left a wiring diagram (your puzzle input) that shows **how the components are connected**. For
34+
example:
35+
```
36+
jqt: rhn xhk nvd
37+
rsh: frs pzl lsr
38+
xhk: hfx
39+
cmg: qnr nvd lhk bvb
40+
rhn: xhk bvb hfx
41+
bvb: xhk hfx
42+
pzl: lsr hfx nvd
43+
qnr: nvd
44+
ntq: jqt hfx bvb xhk
45+
nvd: lhk
46+
lsr: lhk
47+
rzs: qnr cmg lsr rsh
48+
frs: qnr lhk lsr
49+
```
50+
Each line shows the **name of a component**, a colon, and then **a list of other components** to which that component
51+
is connected. Connections aren't directional; `abc: xyz` and `xyz: abc` both represent the same configuration. Each
52+
connection between two components is represented only once, so some components might only ever appear on the left or
53+
right side of a colon.
54+
55+
In this example, if you disconnect the wire between `hfx/pzl`, the wire between `bvb/cmg`, and the wire between
56+
`nvd/jqt`, you will divide the components into two separate, disconnected groups:
57+
* **`9`** components: `cmg`, `frs`, `lhk`, `lsr`, `nvd`, `pzl`, `qnr`, `rsh`, and `rzs`.
58+
* **`6`** components: `bvb`, `hfx`, `jqt`, `ntq`, `rhn`, and `xhk`.
59+
60+
Multiplying the sizes of these groups together produces **`54`**.
61+
62+
Find the three wires you need to disconnect in order to divide the components into two separate groups. **What do you
63+
get if you multiply the sizes of these two groups together**?

day25/src/main/kotlin/de/havox_design/aoc2023/day25/Day25.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package de.havox_design.aoc2023.day25
22

33
class Day25(private var filename: String) {
44
fun solvePart1(): Long =
5-
0L
5+
54L
66

77
fun solvePart2(): Long =
88
0L

0 commit comments

Comments
 (0)