CarGurus interview question

Classic “Valid Parentheses” leetcode problem