public static int longestCommonSubsequenceLength(String x, String y){
		x = '$'+x;
		y = '$'+y;
		int[][] b = new int[x.length()][y.length()];
		int lcs = Integer.MIN_VALUE;
		for(int i=1;i<x.length();i++){
			for(int j=1;j<y.length();j++){
				b[i][j]= Math.max(b[i-1][j],b[i][j-1]);
				if(x.charAt(i)==y.charAt(j)){
					b[i][j]=Math.max(b[i-1][j-1]+1, b[i][j]);
				}
				if(b[i][j]>lcs){
					lcs=b[i][j];
				}
			}
		}
		return lcs;
	}