Bentley Systems interview question

Make a program that matches opened and closed brackets.