public int calLCSLength(char[] X, char[] Y){
        if (X== null || Y == null ) return -1;

        int m = X.length;
        int n = Y.length;

        c = new int[m+1][n+1];
        b = new char[m+1][n+1];

        for (int i = 0; i < m; i++) {
            c[i][0] = 0;
        }
        for (int j = 0; j < n; j++) {
            c[0][j] = 0;
        }

        for (int i = 1; i <= m; i++) {
            for (int j = 1; j <= n; j++) {
                if (X[i-1] == Y[j-1]){
                    c[i][j] = c[i-1][j-1] + 1;
                    b[i][j] = LCS.UPLEFT;
                } else if (c[i-1][j]>=c[i][j-1]){
                    c[i][j] = c[i-1][j];
                    b[i][j] = LCS.UP;
                } else {
                    c[i][j] = c[i][j-1];
                    b[i][j] = LCS.UPLEFT;
                }
            }
        }



        return 0;
    }