Amazon interview question

Balanced brackets.