<awangdev>Longest Common Subsequence_4.java
public int longestCommonSubsequence(String A, String B) {
        if (A == null || B == null || A.length() == 0 || B.length() == 0) {
            return 0;
        }
        int[][] check = new int[A.length()  + 1][B.length() + 1];
        for (int i = 1; i <= A.length(); i++) {
            for (int j = 1; j <= B.length(); j++) {
                if (A.charAt(i - 1) == B.charAt(j - 1)) {
                    check[i][j] = check[i - 1][j - 1] + 1;
                } else {
                    check[i][j] = Math.max(check[i][j], check[i - 1][j]);
                    check[i][j] = Math.max(check[i][j], check[i][j - 1]);
                }
            }
        }
        return check[A.length()][B.length()];
    }
public int sample_funcname ( String var_1 , String var_2 ) {
  if ( var_1 == null || var_2 == null || var_1 . length ( ) == 0 || var_2 . length ( ) == 0 ) {
    return 0 ;
  }
  int [ ] [ ] var_7 = new int [ var_1 . length ( ) + 1 ] [ var_2 . length ( ) + 1 ] ;
  for ( int var_8 = 1 ;
  var_8 <= var_1 . length ( ) ;
  var_8 ++ ) {
    for ( int var_9 = 1 ;
    var_9 <= var_2 . length ( ) ;
    var_9 ++ ) {
      if ( var_1 . charAt ( var_8 - 1 ) == var_2 . charAt ( var_9 - 1 ) ) {
        var_7 [ var_8 ] [ var_9 ] = var_7 [ var_8 - 1 ] [ var_9 - 1 ] + 1 ;
      }
      else {
        var_7 [ var_8 ] [ var_9 ] = Math . max ( var_7 [ var_8 ] [ var_9 ] , var_7 [ var_8 - 1 ] [ var_9 ] ) ;
        var_7 [ var_8 ] [ var_9 ] = Math . max ( var_7 [ var_8 ] [ var_9 ] , var_7 [ var_8 ] [ var_9 - 1 ] ) ;
      }
    }
  }
  return var_7 [ var_1 . length ( ) ] [ var_2 . length ( ) ] ;
}
