Microsoft Interview Question

Matching parenthesis question from the leetcode