Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
3-liner: Harder, Better, Faster, Stronger solution in Creative category for Numbered Triangles by przemyslaw.daniel
from itertools import product as DAFT,permutations as PUNK
checkio=lambda a:max([0]+[sum([x[1]for x in k])for k in[y for x in DAFT(*[PUNK(z)for z in a])
for y in[(x[0],)+w for w in PUNK(x[1:])]]if all([k[i][0]==k[i-1][2]for i in range(6)])])
June 7, 2017
Comments: