Microsoft interview question

write a code on Valid Parenthesis