Help for this page

Select Code to Download


  1. or download this
    my @interval_arrays = map [$a[$_], $b[$_]], 0..$#a;
    
  2. or download this
    my @intersected_arrays = map {
        my $min = $s1 < $_->[0] ? $_->[0] : $s1;
        my $max = $s2 > $_->[1] ? $_->[1] : $s2;
        $min <= $max ? [$min, $max] : ();
    } @interval_arrays;