in reply to Re: Re: amount permutations
in thread amount permutations
In order to make my $count look like your count will require more work - and make the process slower. If you want - you can change the position of $count++ to after the for loop. There you would only be counting the number of combinations that did not have a duplicate number in them and whose combined value was not greater than the target sum.
I would recommend in the real problem removing all candidates that were already larger than the target number.
Cheers - L~R
|
---|