Netenrich Inc. Interview Question

Braceket matching stack based question