Pregunta de entrevista de Tripadvisor

Given a string, determine if brackets are matched.