Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
pre_calculation solution in Clear category for The Einstein Problem-Lite by ciel
color = ['blue', 'green', 'red', 'white', 'yellow']
pet = ['cat', 'bird', 'dog', 'fish', 'horse']
beverage = ['beer', 'coffee', 'milk', 'tea', 'water']
cigarettes = ['Rothmans', 'Dunhill', 'Pall Mall', 'Winfield' , 'Marlboro']
nationality = ['Brit', 'Dane', 'German', 'Norwegian', 'Swede']
number = ['1','2','3','4','5']
import itertools
lst=list(itertools.product(color,pet,beverage,cigarettes,nationality,number))
def answer(data,question):
processed = [l for l in lst if all(sum(e in l for e in d.split('-'))!=1 for d in data)]
q = question.split('-')
row = next(e for e in processed if q[0] in e)
return next(e for e in globals()[q[1]] if e in row)
Jan. 27, 2015
Comments: