Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Seven Segment by fed.kz
TENS = ('BC', 'ABGED', 'ABCDG', 'FGBC', 'AFGCD', 'AFGECD', 'ABC', 'ABCDEFG', 'ABFGCD', 'ABCDEF')
UNITS = tuple(map(str.lower, TENS))
def seven_segment(working, broken):
def segment(obj): return set(filter(str.isupper, obj)), set(filter(str.islower, obj))
tens, units = segment(working)
first, second = segment(set.union(working, broken))
len1 = len(list(filter(lambda x: set(x).issubset(first) and tens.issubset(set(x)), TENS)))
len2 = len(list(filter(lambda x: set(x).issubset(second) and units.issubset(set(x)), UNITS)))
return len1 * len2
Nov. 3, 2018
Comments: