Steven's Dev Blog
Tips to remind for the FUTURE.
Thursday, August 8, 2013
python 3 line to solve 8 queen
from itertools import *
c = range(8)
print len([v for v in permutations(c) if 8==len(set(v[i]+i for i in c))==len(set(v[i]-i for i in c))])
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment