Available question text
Count the number of distinct non-empty subsequences of a binary string (length up to 1e5) that do not have leading zeros except for the single subsequence "0", returning the result modulo 1e9+7. The core challenge is counting unique subsequence patterns under the leading-zero constraint while avoiding duplicates (typically solved with DP/seen-tracking).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1987. Number of Unique Good Subsequences
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source