in reply to array of arrays or not
And then you can intersect with your interval and get a result in the same format with:my @interval_arrays = map [$a[$_], $b[$_]], 0..$#a;
my @intersected_arrays = map { my $min = $s1 < $_->[0] ? $_->[0] : $s1; my $max = $s2 > $_->[1] ? $_->[1] : $s2; $min <= $max ? [$min, $max] : (); } @interval_arrays;
|
|---|