My code is not running, error is timelimit exceeded.
Here’s the link for the code:
Find Upper and lower bound
hey @tanmay8598
1st mistake q not decreasing thats why tle
2nd wrong logic for checking if element exists or not
here look at this taken care for both
i hope your doubt is cleared if yes dont forget to mark the doubt as resolved 
it worked fine but i don’t know how to use maps can u plz explain its working in this code
i have stored all the elements of the array in map at the time of input. In map we can check whether an element is in the array or not in logn time. so if element is not present i have displayed -1 @tanmay8598
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.