Crunchbase Interview Question

variation on Valid Parentheses problem.