Amazon interview question

Paranthesis balancing