Microsoft Interview Question

write a code on Valid Parenthesis