Amazon interview question

Check if parenthesis in an expression are balanced