<awangdev>Distinct Subsequences_1.java
public int numDistinct(String s, String t) {
        if (s == null || t == null || t.length() > s.length()) {
            return 0;
        } else if (s.equals(t)) {
            return 1;
        }
        
        int m = s.length();
        int n = t.length();
        int[][] dp = new int[m + 1][n + 1];
        for (int i = 0; i <= m; i++) {
            for (int j = 0; j <= n; j++) {
                if (j == 0) {
                    dp[i][j] = 1;
                    continue;
                }
                if (i == 0) {
                    dp[i][j] = 0;
                    continue;
                }
                dp[i][j] = dp[i - 1][j];
                if (s.charAt(i - 1) == t.charAt(j - 1)) {
                   dp[i][j] += dp[i - 1][j - 1];
                }
            }
        }
        return dp[m][n];
    }
public int sample_funcname ( String var_1 , String var_2 ) {
  if ( var_1 == null || var_2 == null || var_2 . length ( ) > var_1 . length ( ) ) {
    return 0 ;
  }
  else if ( var_1 . equals ( var_2 ) ) {
    return 1 ;
  }
  int var_8 = var_1 . length ( ) ;
  int var_9 = var_2 . length ( ) ;
  int [ ] [ ] var_10 = new int [ var_8 + 1 ] [ var_9 + 1 ] ;
  for ( int var_11 = 0 ;
  var_11 <= var_8 ;
  var_11 ++ ) {
    for ( int var_12 = 0 ;
    var_12 <= var_9 ;
    var_12 ++ ) {
      if ( var_12 == 0 ) {
        var_10 [ var_11 ] [ var_12 ] = 1 ;
        continue ;
      }
      if ( var_11 == 0 ) {
        var_10 [ var_11 ] [ var_12 ] = 0 ;
        continue ;
      }
      var_10 [ var_11 ] [ var_12 ] = var_10 [ var_11 - 1 ] [ var_12 ] ;
      if ( var_1 . charAt ( var_11 - 1 ) == var_2 . charAt ( var_12 - 1 ) ) {
        var_10 [ var_11 ] [ var_12 ] += var_10 [ var_11 - 1 ] [ var_12 - 1 ] ;
      }
    }
  }
  return var_10 [ var_8 ] [ var_9 ] ;
}
