Google interview question

Find out whether parentheses are right in a string