<awangdev>Longest Common Subsequence_1.java
public int longestCommonSubsequence(String A, String B) {
        if (A == null || B == null || A.length() == 0 || B.length() == 0) {
            return 0;
        }
        int m = A.length();
        int n = B.length();
        int[][] dp = new int[m + 1][n + 1];
        
        for (int i = 0; i <= m; i++) {
            for (int j = 0; j <= n; j++) {
                if (i == 0 || j == 0) {
                    dp[i][j] = 0;
                    continue;
                }
                dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
                if (A.charAt(i - 1) == B.charAt(j - 1)) {
                    dp[i][j] = Math.max(dp[i][j], dp[i - 1][j - 1] + 1);
                }
            }
        }
        return dp[m][n];
    }
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_6 = var_1 . length ( ) ;
  int var_7 = var_2 . length ( ) ;
  int [ ] [ ] var_9 = new int [ var_6 + 1 ] [ var_7 + 1 ] ;
  for ( int var_10 = 0 ;
  var_10 <= var_6 ;
  var_10 ++ ) {
    for ( int var_11 = 0 ;
    var_11 <= var_7 ;
    var_11 ++ ) {
      if ( var_10 == 0 || var_11 == 0 ) {
        var_9 [ var_10 ] [ var_11 ] = 0 ;
        continue ;
      }
      var_9 [ var_10 ] [ var_11 ] = Math . max ( var_9 [ var_10 - 1 ] [ var_11 ] , var_9 [ var_10 ] [ var_11 - 1 ] ) ;
      if ( var_1 . charAt ( var_10 - 1 ) == var_2 . charAt ( var_11 - 1 ) ) {
        var_9 [ var_10 ] [ var_11 ] = Math . max ( var_9 [ var_10 ] [ var_11 ] , var_9 [ var_10 - 1 ] [ var_11 - 1 ] + 1 ) ;
      }
    }
  }
  return var_9 [ var_6 ] [ var_7 ] ;
}
