Pergunta de entrevista da empresa Microsoft

Matching parenthesis question from the leetcode