Gartner Interview Question

DSA based question- Balance brackets