Help for this page

Select Code to Download


  1. or download this
    @union = @intersection = @difference = ();
        %count = ();
    ...
            push @union, $element;
            push @{ $count{$element} > 1 ? \@intersection : \@difference }
    +, $element;
        }
    
  2. or download this
    sub intersection{
     my(%count,@res);
    ...
     @res;
    }
    @a=intersection(\@b,\@c,\@d);