Voleon·Software Engineer·Technical Phone Screen
- A 'good string' is defined recursively: '0' is a good string, and if A and B are both good strings, then '1' + A + B is also a good string. Given a binary string, determine whether it is a good string. Your solution must run in O(n) time.
“My first instinct was to write a recursive parser and call it a day, which technically works but I fumbled explaining the O(n) guarantee because I kept second-guessing whether the recursion would revisit characters.”