MarketAxess interview question

Check for Valid Parenthesis in given string