Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- searchsorted(arr, x, 'left') returns the position i such that arr[i-1] < x <= arr[i],
- so that i is the first one such that x <= arr[i]. Equivalent to lower_bound in c++
- searchsorted(arr, x, 'right') returns the position i such that arr[i-1] <= x < arr[i],
- so that i is the first one such that x < arr[i]. Equivalent to upper_bound in c++
Add Comment
Please, Sign In to add comment