Google Interview Question

Find out whether parentheses are right in a string