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
|
--- Part Two ---
Unfortunately, considering only horizontal and vertical lines doesn't give you the full picture; you
need to also consider [1m[37mdiagonal lines[0m.
Because of the limits of the hydrothermal vent mapping system, the lines in your list will only ever
be horizontal, vertical, or a diagonal line at exactly 45 degrees. In other words:
- An entry like 1,1 -> 3,3 covers points 1,1, 2,2, and 3,3.
- An entry like 9,7 -> 7,9 covers points 9,7, 8,8, and 7,9.
Considering all lines from the above example would now produce the following diagram:
1.1....11.
.111...2..
..2.1.111.
...1.2.2..
.112313211
...1.2....
..1...1...
.1.....1..
1.......1.
222111....
You still need to determine [1m[37mthe number of points where at least two lines overlap[0m. In the above
example, this is still anywhere in the diagram with a 2 or larger - now a total of [1m[37m12[0m points.
Consider all of the lines. [1m[37mAt how many points do at least two lines overlap?[0m
|