Pregunta de entrevista de Capital One

Given a string, implement a function to determine if it has matching/balanced brackets.