Amazon Interview Question

Parenthesis matching similar to leetcode using stack