comefrom: <awangdev>Longest Common Subsequence_2.java
code: 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[2][n + 1];
          
          int curr = 1;
          int prev = 0;
          for (int i = 1; i <= m; i++) {
              prev = curr;
              curr = 1 - prev;
              for (int j = 1; j <= n; j++) {
                  if(i == 0 || j == 0) {
                      dp[i][j] = 0;
                      continue;
                  }
                  dp[curr][j] = Math.max(dp[prev][j], dp[curr][j - 1]);
                  if (A.charAt(i - 1) == B.charAt(j - 1)) {
                      dp[curr][j] = Math.max(dp[curr][j], dp[prev][j - 1] + 1);
                  }
              }
          }
          
          return dp[curr][n];
      }
masked: public int sample_funcname ( String var_0 , String var_1 ) {
    if ( var_0 == null || var_1 == null || var_0 . length ( ) == 0 || var_1 . length ( ) == 0 ) {
      return 0 ;
    }
    int var_2 = var_0 . length ( ) ;
    int var_3 = var_1 . length ( ) ;
    int [ ] [ ] var_4 = new int [ 2 ] [ var_3 + 1 ] ;
    int var_5 = 1 ;
    int var_6 = 0 ;
    for ( int var_7 = 1 ;
    var_7 <= var_2 ;
    var_7 ++ ) {
      var_6 = var_5 ;
      var_5 = 1 - var_6 ;
      for ( int var_8 = 1 ;
      var_8 <= var_3 ;
      var_8 ++ ) {
        if ( var_7 == 0 || var_8 == 0 ) {
          var_4 [ var_7 ] [ var_8 ] = 0 ;
          continue ;
        }
        var_4 [ var_5 ] [ var_8 ] = Math . max ( var_4 [ var_6 ] [ var_8 ] , var_4 [ var_5 ] [ var_8 - 1 ] ) ;
        if ( var_0 . charAt ( var_7 - 1 ) == var_1 . charAt ( var_8 - 1 ) ) {
          var_4 [ var_5 ] [ var_8 ] = Math . max ( var_4 [ var_5 ] [ var_8 ] , var_4 [ var_6 ] [ var_8 - 1 ] + 1 ) ;
        }
      }
    }
    return var_4 [ var_5 ] [ var_3 ] ;
  }
  