Pergunta de entrevista da empresa Bentley Systems

Make a program that matches opened and closed brackets.