Test case failed 3


why 3 test case are failing?

Before accessing ar[x][y], you should check if x and y are valid.
In your code, make sure you are always having this condition.

Didnt get it . Like arr[][] is the input array?

Apologies for a delayed response.
I meant to say that if you have your array ar[5][5] and you are trying to access ar[7][4], it wont happen.
So always have a condition that if i<bound and j<bound, then only access ar[i][j].
In your code, this condition is required.

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.