Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Short (decimal representation) solution in Creative category for Seven Segment by genadiik
def seven_segment(lit_seg, broken_seg):
digits = (126, 48, 109, 121, 51, 91, 95, 112, 127, 123)
count = 1
for pos in ('ABCDEFG', 'abcdefg'):
lit = int(''.join(['1' if c in lit_seg else '0' for c in pos]), 2)
broken = int(''.join(['1' if c in broken_seg else '0' for c in pos]), 2)
count *= len([dig for dig in digits if dig - (dig & broken) == lit])
return count
June 14, 2019