Question d’entretien chez Infosys

Given a string, determine if the parenthesis are valid.