Bounteous x Accolite Interview Question

Find If the string has Valid Parenthesis?