UVa 673 - Parentheses Balance

673 - Parentheses Balance

 * http://acm.uva.es/p/v6/673.html

Summary
Since the language described is a very simple context-free language, we can use a stack to implement the associated push-down automata.

Explanation
The context-free language is as follows: S -> U | V | E U -> [S] V -> (S)

Input
3 ([]) (([]))) ([[]])

Output
Yes No Yes