TIME O(n) || SPACE O(1) || C++
\nclass Solution {\npublic:\n    int numberOfUniqueGoodSubsequences(string binary) {\n        long long int a = 0, b = 0, c = 0, d = 0,mod = 1e9+7;\n        /*s
```\nclass Solution {\npublic:\n    int numberOfUniqueGoodSubsequences(string binary) {\n        long long int a = 0, b = 0, c = 0, d = 0,mod = 1e9+7;\n        /*strart end end a -> 0..0, b -> 0...1, c -> 1....0, d -> 1.....1*/\n        for(auto &i: binary){\n            if(i==\'0\'){\n                a = 1;\n                c = (c+d)%mod;\n            }else{\n                d = (c+d+1)%mod;\n            }\n        }\n        return (a+b+c+d)%mod;\n    }\n};\n```
['Dynamic Programming', 'C', 'C++']