PTC interview question

Similar to the balanced parenthesis problem.