list question... unique values in all possible unique spots

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Mon Aug 11 20:34:53 EDT 2008


Mensanator:
> Ever tried to iterate 403 septillion times?

The OP is talking about formulas, like:
X + Y * Z = W
Where X, Y, Z, W distinct and in [1, 26], so you have C(26, 4)
combinations that's way less than 26!

>>> binomial(26, 4)
14950

So this can be solved with a xcombinations() generator.

Bye,
bearophile



More information about the Python-list mailing list