Summer Sale
Limited Time Deal: Unlock all premium questions for over 30% off
14
:
03
:
46
:
47
Wildcard Segment Counter
You are given a template string consisting only of the characters '0', '1', and '?', and a list of integers run_lengths.
A '?' in the template can be replaced by either '0' or '1'. After all replacements, the resulting binary string must have consecutive runs of '1's with lengths exactly matching run_lengths in order (with at least one '0' separating each run, and no extra '1's outside the runs). Count the number of distinct ways to replace all '?' characters so the resulting string satisfies this condition.
...
OfferRetriever
Master technical interviews with real questions from top companies. Build your confidence and career.
LEGAL
© 2026 Purple Business Holdings LLC. All rights reserved. See Terms of Service.