Solution Review: Print Parentheses Number
Let’s take a detailed look at the previous challenge’s solution.
We'll cover the following...
Solution
A stack is used to keep track of the parenthesis count. A count variable is used to keep track of the count of the current opening parenthesis. Traverse the string and when we get an opening parenthesis, then we add the count to the stack and output. Then, increase the ...