Arm Interview Question

Valid parenthesis problem. Can be found on leetcode