Find the position of the kth element in the interval in which it lies
x = k - total [ index - 1 ] NEW_LINE while ( l <= h ) : NEW_LINE INDENT m = ( l + h ) // 2 NEW_LINE if ( ( m - L [ index - 1 ] ) + 1 == x ) : NEW_LINE INDENT return m NEW_LINE DEDENT elif ( ( m - L [ index - 1 ] ) + 1 > x ) : NEW_LINE INDENT h = m - 1 NEW_LINE DEDENT else : NEW_LINE INDENT l = m + 1 NEW_LINE DEDENT DEDENT