3rd testcase not pass please checkout code and give me suggestion . What is wrong in code

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int m = scan.nextInt();
int[][] arr = new int[n][m];
for(int i=0;i<arr.length;i++) {
for(int j=0;j<arr.length;j++) {
arr[i][j] = scan.nextInt();
}
}
int item = scan.nextInt();
System.out.println(MatrixSearch(arr,item));

}

private static int MatrixSearch(int[][] arr, int item) {

	
     for(int i=0;i<arr.length;i++) {
    	 for(int j=0;j<arr.length;j++) {
    		 if(arr[i][j]==item) {
    			 return 1;
    		 }
    	 }
     }
	
	return 0;
}

}

// 3rd testcase not pass

for the test case:
1 6
18 21 27 38 55 67
55
the output should be 1
debug for this

Thanks di i got my mistake

please mark your doubt as resolved :slight_smile: