Simple DP Solution || C++
Approach\n Describe your approach to solving the problem. \nWe first have to remove leading zeros , and also do not have to include 0 in cnt0 \n# Complexity\n- 
# Approach\n<!-- Describe your approach to solving the problem. -->\nWe first have to remove leading zeros , and also do not have to include 0 in cnt0 \n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(N)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int numberOfUniqueGoodSubsequences(string b) {\n        int lz = -1 , lo = -1; // last undex of zero and one\n        int ind = 0, cnt0 = 0, M = 1e9 + 7;\n        string tem = ""; // this will be new string after removing leading zeros\n        if(b[0] == \'0\') cnt0 = 1;\n        while(ind < b.length() && b[ind] == \'0\') ind++;\n        while(ind < b.length()){ if(b[ind] ==\'0\') cnt0 = 1; tem += b[ind++]; }\n        if(tem == "") return cnt0;\n        vector<int> dp(tem.size()+1,0);\n        dp[0] = 1; // 0 is for null in end we will remove it\n        dp[1] = 2; // first char can have 2 sub sequence\n        lo = 1; // always starting from 1\n        for(int i = 1; i<tem.length();i++){\n            if(tem[i] == \'0\'){  \n                // if we get 0 then if this is first then only we cannot make 0 that\'s wy -1 \n                // else removes previous zero sequences to remove duplicates\n                if(lz == -1) dp[i+1] = (dp[i]*2ll - 1)%M;\n                else dp[i+1] = (dp[i]*2ll - dp[lz-1] )%M;\n                lz = i+1;\n            }else{\n                // similar as of zero \n                if(lo == -1) dp[i+1] = (dp[i]*2ll)%M;\n                else dp[i+1] = (dp[i]*2ll - dp[lo-1])%M;\n                lo = i+1;\n            }\n            if(dp[i+1] < 0 ) dp[i+1] += M;\n        }\n        dp[tem.length()] -= (1-cnt0); // at last we will remove null and add 0 count\n        if(dp[tem.length()] < 0 ) dp[tem.length()] += M;\n        return dp[tem.length()]%M;\n    }\n};\n```
['Dynamic Programming', 'C++']