Can u pls tell me what is the problem in my code i'm unable to find that

static int searchElement(int[][] arr , int element) {
int result=0;
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr.length; j++) {
if(arr[i][j]==element) {
result=1;
}

		}
	}
	return result;
	
}
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int rowsize = sc.nextInt();
	int colsize = sc.nextInt();
	
	int[][] arr = new int[rowsize][colsize];
	for (int row = 0; row < arr.length; row++) {
		for (int col = 0; col < arr.length; col++) {
			 arr[row][col] = sc.nextInt();
		}
	}
	
	
	int element = sc.nextInt();
	int result = searchElement(arr, element);
	System.out.println(result);
}

@nigamshubham1998,
https://ide.codingblocks.com/s/260969 corrected code.

For col you need to use arr[0].length