Question: Answer the following question using c++ language. Make sure you use three files such as a stack.h, stack.tpp, main. 3. Use a stack to determine
Answer the following question using c++ language. Make sure you use three files such as a stack.h, stack.tpp, main.

3. Use a stack to determine whether a string of parenthesis is balanced or not? If the string is not balanced, then print the longest substring that is balanced. If the length of the longest substring is less than 2, print Totally unbalanced. Test case 1: Input: () (((((() () () Output: () () () Test case 2: Input: 0 (0 ()) Output: Balanced Test case 3: Output: ) Output: Totally unbalanced
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
