<awangdev>Distinct Subsequences_3.java
public int numDistinct(String S, String T) {
        int[][] DP = new int[T.length() + 1][S.length() + 1];
        DP[0][0] = 1;
        for(int i = 1; i < S.length(); i++) {
            DP[0][i] = 1;
        }
        for (int i = 1; i < T.length(); i++) {
            DP[i][0] = 0;
        }
        for (int i = 1; i <= T.length(); i++) {
            for (int j = 1; j <= S.length(); j++){
                DP[i][j] = DP[i][j - 1];
                if (T.charAt(i - 1) == S.charAt(j - 1)) {
                    DP[i][j] += DP[i - 1][j - 1];
                }
            }
        }
        return DP[T.length()][S.length()];
    }
public int sample_funcname ( String var_1 , String var_2 ) {
  int [ ] [ ] var_5 = new int [ var_2 . length ( ) + 1 ] [ var_1 . length ( ) + 1 ] ;
  var_5 [ 0 ] [ 0 ] = 1 ;
  for ( int var_7 = 1 ;
  var_7 < var_1 . length ( ) ;
  var_7 ++ ) {
    var_5 [ 0 ] [ var_7 ] = 1 ;
  }
  for ( int var_7 = 1 ;
  var_7 < var_2 . length ( ) ;
  var_7 ++ ) {
    var_5 [ var_7 ] [ 0 ] = 0 ;
  }
  for ( int var_7 = 1 ;
  var_7 <= var_2 . length ( ) ;
  var_7 ++ ) {
    for ( int var_8 = 1 ;
    var_8 <= var_1 . length ( ) ;
    var_8 ++ ) {
      var_5 [ var_7 ] [ var_8 ] = var_5 [ var_7 ] [ var_8 - 1 ] ;
      if ( var_2 . charAt ( var_7 - 1 ) == var_1 . charAt ( var_8 - 1 ) ) {
        var_5 [ var_7 ] [ var_8 ] += var_5 [ var_7 - 1 ] [ var_8 - 1 ] ;
      }
    }
  }
  return var_5 [ var_2 . length ( ) ] [ var_1 . length ( ) ] ;
}
