Help for this page

Select Code to Download


  1. or download this
    my %seen;
    my @intersection = grep ++$seen{$_}==2, @list1, @list2;
    
  2. or download this
    my %seen;
    $seen{$_}=1 for @list1;
    my @intersection = grep ++$seen{$_}==2, @list2;