leetcode Distinct Subsequences DP

2014-11-24 00:04:21 · 作者: · 浏览: 4
class Solution {
public:
    int numDistinct(string S, string T) {
        // Note: The Solution object is instantiated only once and is reused by each test case.
        vector< vector > dp;
        vector row(S.length()+1,0);
		vector ones(S.length()+1,1);
        int i,j;
        
        if(S.length()