Skip to content

Instantly share code, notes, and snippets.

@alaingilbert
Created March 11, 2012 06:14
Show Gist options
  • Save alaingilbert/2015254 to your computer and use it in GitHub Desktop.
Save alaingilbert/2015254 to your computer and use it in GitHub Desktop.
CallTV answer
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)
@jbourassa
Copy link

CallTV? Hahah =D

@alaingilbert
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment