You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.8 KiB
39 lines
1.8 KiB
1 year ago
|
# Day 18: Boiling Boulders
|
||
|
|
||
|
[https://adventofcode.com/2022/day/18](https://adventofcode.com/2022/day/18)
|
||
|
|
||
|
## Description
|
||
|
|
||
|
### Part One
|
||
|
|
||
|
You and the elephants finally reach fresh air. You've emerged near the base of a large volcano that seems to be actively erupting! Fortunately, the lava seems to be flowing away from you and toward the ocean.
|
||
|
|
||
|
Bits of lava are still being ejected toward you, so you're sheltering in the cavern exit a little longer. Outside the cave, you can see the lava landing in a pond and hear it loudly hissing as it solidifies.
|
||
|
|
||
|
Depending on the specific compounds in the lava and speed at which it cools, it might be forming [obsidian](https://en.wikipedia.org/wiki/Obsidian)! The cooling rate should be based on the surface area of the lava droplets, so you take a quick scan of a droplet as it flies past you (your puzzle input).
|
||
|
|
||
|
Because of how quickly the lava is moving, the scan isn't very good; its resolution is quite low and, as a result, it approximates the shape of the lava droplet with _1x1x1 <span title="Unfortunately, you forgot your flint and steel in another dimension.">cubes</span> on a 3D grid_, each given as its `x,y,z` position.
|
||
|
|
||
|
To approximate the surface area, count the number of sides of each cube that are not immediately connected to another cube. So, if your scan were only two adjacent cubes like `1,1,1` and `2,1,1`, each cube would have a single side covered and five sides exposed, a total surface area of _`10`_ sides.
|
||
|
|
||
|
Here's a larger example:
|
||
|
|
||
|
2,2,2
|
||
|
1,2,2
|
||
|
3,2,2
|
||
|
2,1,2
|
||
|
2,3,2
|
||
|
2,2,1
|
||
|
2,2,3
|
||
|
2,2,4
|
||
|
2,2,6
|
||
|
1,2,5
|
||
|
3,2,5
|
||
|
2,1,5
|
||
|
2,3,5
|
||
|
|
||
|
|
||
|
In the above example, after counting up all the sides that aren't connected to another cube, the total surface area is _`64`_.
|
||
|
|
||
|
_What is the surface area of your scanned lava droplet?_
|