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; }