Code for staircase search

do we always have to start(place pointers i & j) from the top right corner position.
also please give the entire code.

yes it helps to optimise the code
https://ide.codingblocks.com/s/231639

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.

The doubt was reopened. Is your doubt resolved?

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.