Pregunta de entrevista de Bentley Systems

Make a program that matches opened and closed brackets.