Validating Magical Binary Strings with RegEx (NG)

Problem Overview

  • Write a regex to validate magical binary strings: must start with 1, include at least two 0s, and have an even number of 0s.
  • Input: up to 10^3 queries with strings of length up to 10^3; output: True/False per match.
  • Domain: regex-based text processing and binary string validation.
  • Asked in Wayfair interviews; a coding interview problem and interview question on pattern matching.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: