in reply to Compare two arrays of simple numbers
sub comp { my ($a, $b) = @_; return 0 if @$a != @$b; my @c; ++$c[$_] for @$a; --$c[$_] for @$b; $_ != 0 && return 0 for grep defined, @c; return 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Compare two arrays of simple numbers
by erroneousBollock (Curate) on Oct 03, 2007 at 08:27 UTC | |
by Prof Vince (Friar) on Oct 03, 2007 at 08:36 UTC |