upper bound and lower bound functions can be directly used to find to first and last occ ?
First and last occurence
sorry for the delay @divyam_13
upper bound can be used to find the last occurence and lower bound in some cases. but you can modify binary search to do it also. best way is to try on your compiler and see what upper and lower gives
1 Like