blob: f9c8da3efc920d76789b89cfe7c960b2805be675 (
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
--- Part Two ---
Through a little deduction, you should now be able to determine the remaining digits. Consider again
the first example above:
acedgfb cdfbe gcdfa fbcad dab cefabd cdfgeb eafb cagedb ab |
cdfeb fcadb cdfeb cdbaf
After some careful analysis, the mapping between signal wires and segments only make sense in the
following configuration:
dddd
e a
e a
ffff
g b
g b
cccc
So, the unique signal patterns would correspond to the following digits:
- acedgfb: 8
- cdfbe: 5
- gcdfa: 2
- fbcad: 3
- dab: 7
- cefabd: 9
- cdfgeb: 6
- eafb: 4
- cagedb: 0
- ab: 1
Then, the four digits of the output value can be decoded:
- cdfeb: [1m[37m5[0m
- fcadb: [1m[37m3[0m
- cdfeb: [1m[37m5[0m
- cdbaf: [1m[37m3[0m
Therefore, the output value for this entry is [1m[37m5353[0m.
Following this same process for each entry in the second, larger example above, the output value of
each entry can be determined:
- fdgacbe cefdb cefbgd gcbe: 8394
- fcgedb cgb dgebacf gc: 9781
- cg cg fdcagb cbg: 1197
- efabcd cedba gadfec cb: 9361
- gecf egdcabf bgf bfgea: 4873
- gebdcfa ecba ca fadegcb: 8418
- cefg dcbef fcge gbcadfe: 4548
- ed bcgafe cdgba cbgef: 1625
- gbdfcae bgc cg cgb: 8717
- fgae cfgab fg bagce: 4315
Adding all of the output values in this larger example produces [1m[37m61229[0m.
For each entry, determine all of the wire/segment connections and decode the four-digit output
values. [1m[37mWhat do you get if you add up all of the output values?[0m
|