Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Count binary strings formed by replacing '?' in a pattern while respecting fixed '0' and '1' characters.
Consecutive '1' segments must exactly match the lengths and order specified in the input array.
Each valid combination must satisfy both the pattern constraints and the sequential run-length requirements.
What This Tests
Dynamic programming with memoization
Multi-index state tracking across two sequences
Combinatorial counting under strict structural constraints
Recursive decomposition with overlapping subproblems
Common Patterns
Dynamic Programming
Backtracking
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Report
Report seen similar question in interview
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
python
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected