If target lies beyond the max element , than the index of strictly smaller value than target should be ( end - 1 )
if ( target > arr [ end - 1 ] ) return end - 1 ; int start = 0 ; int ans = -1 ; while ( start <= end ) { int mid = ( start + end ) / 2 ;