New York Times Interview Question

Valid parentheses leetcode easy question