Pearl interview question

Write program to solve 'Balanced Brackets in an expression' problem?