Test case 3 and 4 not passing

Here is the code I wrote for this problem which is almost similar to the code given by bhaiyya, still I don’t know why my test cases 3 and 4 are not passing.

Can you help me identify my mistake?

It shows “Wrong answer” as the output for test cases 3 and 4.

@righley you have taken row input in n and column in m but everywhere you are using m as row and n as column.

oh yes, got it! Thanks a lot :slight_smile: