Retired

Broken seven-segment display (retired)

Description:

A seven-segment display (SSD), or seven-segment indicator, is a form of electronic display device for displaying decimal numerals.

![alt text][sev_seg]

Above is a diagram of the seven-segment display I am using. However, some of its segments are broken. When I try to display the number a, it becomes the number b instead.

Task

Your task is to find the possible broken segments given the numbers a and b as strings. There will be multiple SSDs forming a number, so you must return the broken segments of an SSD in a set, return an empty set if an SSD does not seem to be broken.

If a can not become b, throw an exception.

Examples

sev_seg('1000','1007') should equal [set(),set(),set(),{'D','E','F'}]
sev_seg('888','123') should equal [{'A','D','E','F','G'},{'C','F'},{'E','F'}]
sev_seg('-23',' 23') should equal [{'G'},set(),set()]
sev_seg('123','123') should equal [set(),set(),set()]
sev_seg('123','888') should throw Exception 'Invalid input'

Important notes

  • If an SSD is not displaying anything, it will be ' '.
  • If an SSD is displaying '-', only the G segment is working.
  • a and b will always be strings of valid characters with the same length.
  • You may report to me if the description is too confusing.
Puzzles

More By Author:

Check out these other kata created by 0xbba

Stats:

CreatedDec 6, 2018
Warriors Trained12
Total Skips0
Total Code Submissions37
Total Times Completed9
Python Completions9
Total Stars0
% of votes with a positive feedback rating31% of 8
Total "Very Satisfied" Votes1
Total "Somewhat Satisfied" Votes3
Total "Not Satisfied" Votes4
Total Rank Assessments5
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • 0xbba Avatar
Ad