Output toh sahi de rha h

test case passed : 1
test case failed :5
find upper bound and lower bound

In this question first check whether an element exist in array or not.
You can use binary_search stl to check this then find lower/upper bound.
eg. 1 2 3 5 6
in this, lower_bound(4) is 2 but ans should be -1.

@pratyush63

han lekin uske liye toh condition lagayi h na mene if((c-a)==n) toh output<<-1

agar key nhi milegi toh c-a =n , hota h na

@pratyush63
kya hua bhai reply kyu nhi de rhe ?

Consider the case:
5
1 2 3 5 6
1
4

Expected output:
-1 -1

But your output:
3 2

Dry run and check for this case.And try to correct.
If that query is not in that array, you are suppose to print -1. So include an extra condition for this.

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.