Print smallest index whose value greater than or equal to Q [ i ]
document . write ( minIdx [ pos ] + " " ) ; } } function lower_bound ( arr , element ) { for ( let i = 0 ; i < arr . length ; i ++ ) if ( element <= arr [ i ] ) return i ; return arr . length ; }