Created
March 11, 2012 06:14
-
-
Save alaingilbert/2015254 to your computer and use it in GitHub Desktop.
CallTV answer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
v = {'A': list('CDFIKEGJLPQHMRSNU'), | |
'B': list('CEHNUDGMTFJRILKPO'), | |
'C': list('ABDFIKOEHNU'), | |
'D': list('ACBFIKOGMS'), | |
'E': list('ACBHNUGJLP'), | |
'F': list('AJROKIDCB'), | |
'G': list('ADMSPLJEB'), | |
'H': list('ACENUBMR'), | |
'I': list('ALQOKFDCB'), | |
'J': list('AFRPLGEB'), | |
'K': list('APOIFDCB'), | |
'L': list('AIQPJGEB'), | |
'M': list('ADGSRHB'), | |
'N': list('ACEHUBT'), | |
'O': list('KIFDCBPQRSTU'), | |
'P': list('AKLJGEBOQRSTU'), | |
'Q': list('AILOPRSTU'), | |
'R': list('AFJMHBOPQSTU'), | |
'S': list('ADGMOPQRTU'), | |
'T': list('BNOPQRSU'), | |
'U': list('ACEHNBOPQRST')} | |
lines = [list('ACEHNU'), | |
list('ADGMS'), | |
list('AFJR'), | |
list('AILQ'), | |
list('AKP'), | |
list('BCDFIKO'), | |
list('BEGJLP'), | |
list('BHMR'), | |
list('BNT'), | |
list('BU'), | |
list('OPQRSTU')] | |
res = set() | |
for first in v: | |
for second in v[first]: | |
for third in v[second]: | |
if first in v[third]: | |
all = False | |
for line in lines: | |
if first in line and second in line and third in line: | |
all = True | |
break | |
if all: continue | |
tmp = [first, second, third] | |
tmp.sort() | |
res.add(tuple(tmp)) | |
print len(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CallTV? Hahah =D