Balancing Parentheses Using Stack