There's more than one way to do things | |
PerlMonks |
Re: Sum of N elements in an M element arrayby Corion (Patriarch) |
on Feb 01, 2020 at 09:11 UTC ( [id://11112220]=note: print w/replies, xml ) | Need Help?? |
There are many simple ways to do this. I would look at Data::PowerSet to generate sets of all numbers to sum, or program it myself by using the binary digits of a counter to indicate whether an element should be included:
What code have you written and where do you have problems?
In Section
Seekers of Perl Wisdom
|
|