Exadatum interview question

balanced parathesis code