Medtronic Interview Question

check parenthesis balancing