Matrix search coding

why this is failed for one case link of code is https://ideone.com/fEjULn

Hi @vivan.singh
You are getting wrong answer because in both the for loops of j you are adding a constraint that j<n but it should be j<m as number of columns are m not n.