Please tell how to approach the given promblem

please tell how to answer the given question

Hi @harryson

In this question, you have to find lower_bound(val) meaning the first position in the array which has value not less than val and upper_bound(val) meaning the first position which has value greater than val. You can try this question by using binary search. Now try it on your own once.

Hope it Helps.

@harryson
Please mark your doubt as solved.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.