public static int LCS(int[] x, int[] y) {
		int[][] dp = new int[x.length + 1][y.length + 1];
		int n = x.length;
		int m = y.length;
		for (int i = 0; i < n + 1; i++)
			for (int j = 0; j < m + 1; j++)
				if (i == 0 || j == 0)
					dp[i][j] = 0;
				else if (x[i - 1] == y[j - 1])
					dp[i][j] = dp[i - 1][j - 1] + 1;
				else
					dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
		return dp[x.length][y.length];
	}