fork(2) download
  1. from itertools import *
  2. print len(list(filter(
  3. lambda candidate: all(imap(
  4. lambda index: sum(imap(lambda _: _[index], candidate)) == 2,
  5. xrange(5)
  6. )),
  7. product(set(permutations([0,0,0,1,1])), repeat=5)
  8. )))
  9.  
Success #stdin #stdout 0.49s 8832KB
stdin
Standard input is empty
stdout
2040