Bloomberg interview question

LC20 (Valid Parentheses, with a twist)