What's the issue in this code?


I think condition for while loop is not correct. So, Please tell.

In staircase search, you take the top right element of the matrix as the starting point (as this is a point in matrix from where if you move downwards, the number increases and if you move leftwards, the number decreases).
But in the code you have taken a[0][0] as the starting point. This is not the correct starting point for staircase search as on both the directions (rightwards and downwards) ,the elements increases.
Please watch the lecture video of Staircase search for more clarity.

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.