Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from itertools import permutations, product
- gens = len([f for f in permutations(range(10), r=6) if f[0] != 0 and all(sum(x) % 2 != 0 for x in zip(f, f[1:]))])
- genf = len([a for a in product(range(10), repeat=4) if a[0] != 0 and all(s[0] != s[1] for s in zip(a, a[1:]))])
- print([gens, genf].index(max(gens, genf))+1, max(gens, genf) - min(gens, genf))
Advertisement
Add Comment
Please, Sign In to add comment