C++ || DP Solution
\nclass Solution {\npublic:\n   int numberOfUniqueGoodSubsequences(string binary) {\n        bool hasZero = false;\n        int endWithZeroes=0,endWithOnes=0,mo
```\nclass Solution {\npublic:\n   int numberOfUniqueGoodSubsequences(string binary) {\n        bool hasZero = false;\n        int endWithZeroes=0,endWithOnes=0,mod=1e9+7;\n        \n        for(auto b:binary){\n            if(b==\'1\'){\n                endWithOnes = (endWithOnes + endWithZeroes + 1)%mod;\n            }else{\n                hasZero=true;\n                endWithZeroes = (endWithOnes + endWithZeroes)%mod;\n            }\n        }\n        \n        return (endWithOnes + endWithZeroes + hasZero)%mod;\n    }\n};\n```
[]