Question d’entretien chez JWP (JW Player)

How you write a program to balance parentheses?