Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Permutations (6 lines) solution in Creative category for Place Queens by StefanPochmann
from itertools import *
def place_queens(placed):
for p in permutations('abcdefgh'):
full = {c+r for c,r in zip(p, '12345678')}
if placed <= full and len({ord(c)+ord(r)*m for c,r in full for m in (1,-1)}) == 16:
return full
return set()
April 28, 2015
Comments: