Domanda di colloquio di Allscripts

Write a function that returns true if the string has balanced parentheses and false if it does not.