Pregunta de entrevista de HARMAN

In dsa they asked valid parenthesis problem