Question d’entretien chez Microsoft

Matching parenthesis question from the leetcode