PointClickCare interview question

Algorithm to count open-closed parenthesis block