All Questions
2 questions
7
votes
2
answers
2k
views
Generate all combinations of certain digits
Related to another answer of mine on Project Euler 35, I found the need to calculate all combinations of certain digits, i.e. 1, 3, 7 and 9, below a given n. I ...
5
votes
2
answers
11k
views
Python generator function that yields combinations of elements in a sequence sorted by subset order
In Python, itertools.combinations yields combinations of elements in a sequence sorted by lexicographical order. In the course of solving certain math problems, I ...