Bounteous x Accolite interview question

Find If the string has Valid Parenthesis?