<awangdev>Distinct Subsequences_4.java
public int numDistinct(String S, String T) {
        if (S.length() == 0) {
            return T.length() == 0 ? 1 : 0;
        }
        if (T.length() == 0) {
            return 1;
        }
        int count = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == T.charAt(0)) {
                count += numDistinct(S.substring(i + 1), T.substring(1));
            }
        }
        return count;
    }
public int sample_funcname ( String S , String T ) {
  if ( S . length ( ) == 0 ) {
    return T . length ( ) == 0 ? 1 : 0 ;
  }
  if ( T . length ( ) == 0 ) {
    return 1 ;
  }
  int count = 0 ;
  for ( int i = 0 ;
  i < S . length ( ) ;
  i ++ ) {
    if ( S . charAt ( i ) == T . charAt ( 0 ) ) {
      count += numDistinct ( S . substring ( i + 1 ) , T . substring ( 1 ) ) ;
    }
  }
  return count ;
}
