Chase interview question

Valid Parenthesis