Google interview question

Matching parenthesis