Expedia Group Interview Question

How would you check if a string of parenthesis are valid?