Practice Number of Unique Good Subsequences
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given a binary string binary. A subsequence of binary is considered good if it is not empty and has no leading zeros (with the exception of "0"). Find the number of unique good subsequences of binary. Return the number of unique good subsequences of binary. Since the answer may be very large, return it modulo 10^9 + 7. A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
Source: Number of Unique Good Subsequences on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
binary = "001"
2
# Example 2
binary = "11"
2
# Example 3
binary = "101"
5
Constraints
Related LeetCode Problems
Practice more problems similar to Number of Unique Good Subsequences.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.