First and last occurence

sir please chack the code , it is giving wrong answer and i am not able to find error.
link ->> https://ide.codingblocks.com/s/574647

first you have to print lower_bound() and then upper_bound()

Modified code

sir i am not able to use inbuilt lower and upper bound function in this question . please tell how to do in this.

i don’t say to use inbuilt function

i am saying in your code first call your lower function and then upper function

as i have done in modified code

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.