Regarding the code

sir,

Is this code right for search in row and column wise sorted 2-D array ???

Hey @gargshivam2001 there are two mistakes in your code which you haven’t considered.

  • Size of 2-d array is not necessary nxn , it’s ideally mxn or nxm based on question.
  • what if the element is not present in your 2-d array, see this case, it will give you TLE.

what condtion we have to add if element is not there ???
please share the code !!!

See this code

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.