Validating Magical Binary Strings with RegEx (NG)

Asked at Wayfair · Coding Questions · Difficulty: Medium · Last asked Jul 15, 2026

We consider a binary string (i.e., a string consisting of 0s and 1s) to be **magical** if it satisfies the following constraints:

Loading the problem…