Help for this page
use List::Util qw( min max ); sub overlap { ... my $right = min( map $_->[ 1 ], @intervals ); return max( 0, $right - $left ); }