HCLTech interview question

Program to identify open and closed brackets