2 ms·
I like the Python-way, which allows to iterate over permutations and combinations without generating everything upfront. https://docs.python.org/2/library/iter
by amelius 8y ago
I like the Python-way, which allows to iterate over permutations and combinations without generating everything upfront.
https://docs.python.org/2/library/itertools.html https://docs.python.org/2/library/itertools.html
- saagarjha 8y agoSo lazy evaluation, really. This can help tame some instances of combinatorial explosions if you can filter the result enough before you concretize the result, but if you’re not careful you’ll end up in a long loop just like you would with an eager method.
- amelius 8y agoYes, use with care.