2025(08): solve part 1 (it's not quick)
CPU times: user 3.14 s, sys: 0 ns, total: 3.14 s Wall time: 3.15 s
This commit is contained in:
@ -57,3 +57,11 @@ This process continues for a while, and the Elves are concerned that they don't
|
||||
After making the ten shortest connections, there are 11 circuits: one circuit which contains _5_ junction boxes, one circuit which contains _4_ junction boxes, two circuits which contain _2_ junction boxes each, and seven circuits which each contain a single junction box. Multiplying together the sizes of the three largest circuits (5, 4, and one of the circuits of size 2) produces _`40`_.
|
||||
|
||||
Your list contains many junction boxes; connect together the _1000_ pairs of junction boxes which are closest together. Afterward, _what do you get if you multiply together the sizes of the three largest circuits?_
|
||||
|
||||
### Part Two
|
||||
|
||||
The Elves were right; they _definitely_ don't have enough extension cables. You'll need to keep connecting junction boxes together until they're all in _one large circuit_.
|
||||
|
||||
Continuing the above example, the first connection which causes all of the junction boxes to form a single circuit is between the junction boxes at `216,146,977` and `117,168,530`. The Elves need to know how far those junction boxes are from the wall so they can pick the right extension cable; multiplying the X coordinates of those two junction boxes (`216` and `117`) produces _`25272`_.
|
||||
|
||||
Continue connecting the closest unconnected pairs of junction boxes together until they're <span title="I strongly recommend making an interactive visualizer for this one; it reminds me a lot of maps from futuristic space games.">all in the same circuit</span>. _What do you get if you multiply together the X coordinates of the last two junction boxes you need to connect?_
|
||||
|
||||
Reference in New Issue
Block a user