Sort the vector based on l - value of the intervals
tup . sort ( ( a , b ) => { if ( a [ 0 ] [ 0 ] == b [ 0 ] [ 0 ] ) { return a [ 0 ] [ 1 ] - b [ 0 ] [ 1 ] ; } var tmp = ( a [ 0 ] [ 0 ] - b [ 0 ] [ 0 ] ) ; console . log ( tmp ) ; return ( a [ 0 ] [ 0 ] - b [ 0 ] [ 0 ] ) } ) ;