Global Payments interview question

Coding challenge - check for balanced parentheses