Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Seven Segment by KareeO
def seven_segment(lit_seg, broken_seg):
digit = ['abcdef', 'bc', 'abged', 'abgcd', 'fgbc', 'afgcd', 'afgcde', 'abc', 'abcdefg', 'abcdfg']
num = [set(s.upper()).union(set(t)) for s in digit for t in digit]
return len([s for s in num if lit_seg.union(broken_seg) >= s>= lit_seg])
if __name__ == '__main__':
assert seven_segment({'B', 'C', 'b', 'c'}, {'A'}) == 2, '11, 71'
assert seven_segment({'B', 'C', 'a', 'f', 'g', 'c', 'd'}, {'A', 'G', 'D', 'e'}) == 6, '15, 16, 35, 36, 75, 76'
assert seven_segment({'B', 'C', 'a', 'f', 'g', 'c', 'd'}, {'A', 'G', 'D', 'F', 'b', 'e'}) == 20, '15...98'
print('"Run" is good. How is "Check"?')
Feb. 24, 2020