Microsoft Interview Question

Valid Parentheses with extra chars