Pergunta de entrevista da empresa Mozilla

Determine whether a string of brackets+parens is balanced.