Driver program to test above function
let arr = [ new Pair ( 5 , 24 ) , new Pair ( 15 , 25 ) , new Pair ( 27 , 40 ) , new Pair ( 50 , 60 ) ] ; document . write ( " " + maxChainLength ( arr , arr . length ) ) ;