Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
3-liner: bonsai tree solution in Creative category for Place Queens by przemyslaw.daniel
def place_queens(p,q='abcdefgh',r='12345678',i=__import__('itertools'),f=abs,g=ord):
m=i.permutations;n=i.combinations;return next((k for k in[{''.join(x)for x in zip(y,r)}
for y in m(q)]if all([f(g(a)-g(c))!=f(g(b)-g(d))for(a,b),(c,d)in n(k,2)])and p
July 20, 2017
Comments: