Pregunta de entrevista de JWP (JW Player)

How you write a program to balance parentheses?