Driver code
var a = [ new pair ( 1 , 3 ) , new pair ( 4 , 7 ) , new pair ( 8 , 11 ) ] ; var n = a . length ; var k = 6 ; var index = findNumber ( a , n , k ) ; if ( index != - 1 ) document . write ( index ) ; else document . write ( - 1 ) ;