in reply to Re: Re: Re: amount permutations
in thread amount permutations
Ah, what I meant was, with your code, if there were two checks with the same amount. ie. A = 10 and G = 10, it wouldn't match a search for amount 20 since your array would look like this: my $RS = [10, 5, 13, 3, 15, 1, 4, 10]; And your line here return 0 if $uniq{$val} > 1; would ignore it thinking it was a duplicate in the sequence.
It was a very slight change to pass the array of unique checks instead of the array of amounts and then:
$sum += $rs_ref->{$check}->{'amount'};
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: Re: amount permutations
by Limbic~Region (Chancellor) on Mar 05, 2004 at 15:54 UTC | |
by the_0ne (Pilgrim) on Mar 05, 2004 at 16:36 UTC | |
by Limbic~Region (Chancellor) on Mar 05, 2004 at 16:44 UTC |