Accenture interview question

Create a function that checks for balanced brackets.