Function that returns true if the assignment of directions is possible
function isPossible ( range , N ) { let test = new Array ( N ) ; for ( let i = 0 ; i < N ; i ++ ) { test [ i ] = new interval ( ) ; test [ i ] . l = range [ i ] [ 0 ] ; test [ i ] . r = range [ i ] [ 1 ] ; test [ i ] . v = range [ i ] [ 2 ] ; }