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:

Then, the four digits of the output value can be decoded:

Therefore, the output value for this entry is 5353.

Following this same process for each entry in the second, larger example above, the output value of each entry can be determined:

Adding all of the output values in this larger example produces 61229.

Assignment

For each entry, determine all of the wire/segment connections and decode the four-digit output values. What do you get if you add up all of the output values? Determine this in the following way:

Example

In this interactive session we assume the text files displays01.txt1 and displays02.txt2 to be located in the current directory.

> search("displays01.txt")
61229
> search("displays02.txt")
1070188