Amazon interview question

Valid Parentheses; use queue properly