Comeet Interview Question

Write a code for finding properly closed brackets.