blob: f27da7a6744c08bc20421d1cd8ed95b79347e5ea (
plain) (
blame)
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
|
--- Part Two ---
Next, you need to find the largest basins so you know what areas are most important to avoid.
A [1m[37mbasin[0m is all locations that eventually flow downward to a single low point. Therefore, every low
point has a basin, although some basins are very small. Locations of height 9 do not count as being
in any basin, and all other locations will always be part of exactly one basin.
The [1m[37msize[0m of a basin is the number of locations within the basin, including the low point. The
example above has four basins.
The top-left basin, size 3:
[1m[37m21[0m99943210
[1m[37m3[0m987894921
9856789892
8767896789
9899965678
The top-right basin, size 9:
21999[1m[37m43210[0m
398789[1m[37m4[0m9[1m[37m21[0m
985678989[1m[37m2[0m
8767896789
9899965678
The middle basin, size 14:
2199943210
39[1m[37m878[0m94921
9[1m[37m85678[0m9892
[1m[37m87678[0m96789
9[1m[37m8[0m99965678
The bottom-right basin, size 9:
2199943210
3987894921
9856789[1m[37m8[0m92
876789[1m[37m678[0m9
98999[1m[37m65678[0m
Find the three largest basins and multiply their sizes together. In the above example, this is 9 *
14 * 9 = [1m[37m1134[0m.
[1m[37mWhat do you get if you multiply together the sizes of the three largest basins?[0m
|