Check for balanced parentheses using stack
For example, parentheses could indicate any of the following: A negative amount, such as a negative balance in your check register. A credit balance in an account that normally has a debit balance, or a debit balance in an account that normally has a credit balance.