Help for this page

Select Code to Download


  1. or download this
    my %seen;
    my @filtered = grep !$seen{$_}++, @arr2;
    
  2. or download this
    my %seen;
    my %in_arr1 = map { $_ => 1 } @arr1;
    my @filtered = grep !$in_arr1{$_} || !$seen{$_}++, @arr2;