Help for this page

Select Code to Download


  1. or download this
    my @b;
    for (@a) {
       push @b, $_ if !@b || $_ ne $b[-1];
    }
    
  2. or download this
    my @b = list_reduce { 0, $a || $b ne $_->[-1] ? $b : () } 1, @a;