Function to return the index of the key in arr [ l . . h ] if the key is present otherwise return - 1
function search ( arr , l , h , key ) { if ( l > h ) return - 1 ; let mid = parseInt ( ( l + h ) / 2 , 10 ) ; if ( arr [ mid ] == key ) return mid ;