Requirements
- Make a stack data structure
- Let the user input a string of different types of parentheses
- Iterate across the string and perform the operations as follows:
- Push to the stack a character of the supplied string iff it is an opening parenthesis
- If a character is a closing parenthesis, perform the following:
- Check if the stack is not empty and the opening parenthesis on top of the stack is corresponding to the closing parenthesis
- If yes, then pop the parenthesis on top of the stack
- Keep on printing the pushed parentheses on the stack as well as the popped