Question d’entretien chez First Derivatives

Stack parentheses question from leetcode