Matrix Search Problem

Please tell the mistake in my code

hi grahil
let take an example
matrix is
3 3
4 5 6
7 8 9
1 2 3
and key is 5 then
u have to stop if u find the key and u r searching the whole matrix therefore u r getting to another element after finding the key so ur all case will have a=0

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.