Microsoft interview question

Check for Balanced Brackets in an expression.