there is a problem:
I have 5 letters – a,b,c,d,e and 20 places. I have to use each letter at least once but no more than 10 times. So the result can look like {a,a,a,a,a,a,a,a,a,a,b,b,b,b,b,b,b,c,d,e},… etc. I need to find all possibilities.
I was trying something like this:
With[{n = 5, k = 20}, Join @@ Table[IntegerPartitions[s, {k}, Range[n]], {s, k, n k}]]
And then changing numbers to letters. Then I can delete cases where there is no a,b,c,d or e and also cases with more than 10 same letters.
But I would prefer a solution, where I don’t have to delete these cases but I can set conditions before evaluation. Thanks for your help!