Scribd Inc. interview question

1. Write Valid Parentheses check code.