Swift and Rust solutions
\n# Code\nswift\n\nclass Solution {\n    func numberOfUniqueGoodSubsequences(_ binary: String) -> Int {\n        var e0 = 0\n        var e1 = 0\n        var h0 
\n# Code\nswift\n```\nclass Solution {\n    func numberOfUniqueGoodSubsequences(_ binary: String) -> Int {\n        var e0 = 0\n        var e1 = 0\n        var h0 = 0\n        for bi in Array(binary) {\n            if bi == "1" {\n                e1 = (e0 + e1 + 1) % 1_000_000_007\n            } else {\n                e0 = (e0 + e1) % 1_000_000_007\n                h0 = 1\n            }\n        }\n        return (e0 + e1 + h0) % 1_000_000_007\n    }\n}\n\n```\nrust\n```\nimpl Solution {\n    pub fn number_of_unique_good_subsequences(binary: String) -> i32 {\n        let mut e0 = 0;\n        let mut e1 = 0;\n        let mut h0 = 0;\n        for bi in &binary.chars().collect::<Vec<char>>() {\n            if(bi==&\'1\'){\n                e1 = (e0+e1+1)%1000000007;\n            } else {\n                e0 = (e0 + e1)%1000000007;\n                h0 = 1;\n            }\n        }\n        return (e0+e1+h0)%1000000007;\n    }\n}\n```\n
['Swift', 'Rust']