can you plz help me to pass all the test cases
Plz help me clear all test cases
hello @manav_sharma
u r assuming that if key is not presnt then it will return end of the array which is wrong.
lower bound return iterator that is greater than or equal to key.
upper bound return iterator that is greater than key.
for ex->
if array is
1 2 3 7 8 9
and key is 4
the lower/upper bound will return iterator of 7 which is clearly not the end of the array.
first use binary search to check wheter key is present or not.
if not present then simply print -1 -1
otherwise use lower bound ,upper bound
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.