Bloomberg Interview Question

Valid Parentheses Stack Question with Follow Up