Whats wrong in my code?

import java.util.Scanner;

public class ArrayTry {
static Scanner scn = new Scanner(System.in);

public static void main(String[] args) {
	int m = scn.nextInt();
	int n = scn.nextInt();
	int[][] array = new int[m][n];
	for (int i = 0; i < array.length; i++) {
		for (int j = 0; j < array[i].length; j++) {
			array[i][j] = scn.nextInt();
		}
	}
	int s = scn.nextInt();
	int v = Display(array, s);
	System.out.println(v);

}

public static int Display(int[][] arr, int s) {

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

	}
	return 0;
}

}

hey @Harsh_Sonwani
Your code will fail M! = N

just a change in Dispaly fun
for (int j = 0; j < arr[i].length; j++) instead of for (int j = 0; j < arr.length; j++)
I tell you one thing . This approach is not good for this particular question I would suggest using something like binary search

sr maine whi likha hai

@Harsh_Sonwani code Submit hgya??

y u r saying this is not the gooood appproach

@Harsh_Sonwani Yes .