I did not understand that why this algorithm works? How can we be sure that if condition is satisfied the other end will not have a peak?
Algorithm working
hello @vishakha_narang
if a condition is satisfied then we can definitely have a peak that side.
but for other side we cannot comment, it may or may not be present.
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.