Open Nickleaton opened 2 years ago
x digits sum to total
import itertools.product as cardinal_product choices = {} for numbers in cardinal_product(digits * x): if sum(numbers) == Total: # or product or ... choices |= set(numbers)
Then add restrictions for the resulting choices set.
x digits sum to total
import itertools.product as cardinal_product choices = {} for numbers in cardinal_product(digits * x): if sum(numbers) == Total: # or product or ... choices |= set(numbers)
Then add restrictions for the resulting choices set.