Pregunta de entrevista de Cisco

Check if a string is balanced (with parentheses, brackets etc.)