Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: combinations of multiple variables which can assume multiple valuesby Cristoforo (Curate) |
on Apr 24, 2018 at 19:38 UTC ( [id://1213494]=note: print w/replies, xml ) | Need Help?? |
As an exercise related to this problem (not solving the whole problem),
I wanted to find an algorithm for 'variations_with_repetitions', (algorithms not being my strong suit), and was able to find a solution. I wouldn't say it is pretty, but it works :-)
It doen't have an iterative solution. Instead it returns all the tuples.
Update: A better approach using choroba's solution in an iterative fashion could be:
In Section
Seekers of Perl Wisdom
|
|