Atlassian Interview Question

Detect if a string of parenthesis is balanced