Matrix search: One test case wrong!

hey @sanya2508, there are logical errors in ur code, in will fail on many test cases. Can you dry run ur code for 1-2 cases.

I have tried, and it’s working fine with other cases.

try these cases:

3 5
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
12

4 3
3 4 5
6 7 8
9 10 11
8

1 Like

in both of these cases ans should be 1

1 Like