Arm interview question

Valid parenthesis problem. Can be found on leetcode