Domanda di colloquio di JWP (JW Player)

How you write a program to balance parentheses?