Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import itertools
- s=set()
- for a,b,c,d,e,f,g,h,i in itertools.permutations('abcdefghi'):
- #a b c
- #d e f
- #g h i
- x=[('+',a,e,i),('+',g,b,f),('+',d,h,c),('-',g,e,c),('-',d,b,i),('-',a,h,f)]
- s.add(''.join(sorted(''.join(sorted(l)) for l in x)))
- print len(s)
- 10080
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement