Solution Review: Balanced Parenthesis
Let's discuss in detail the solution to the previous challenge.
We'll cover the following...
Solution
-
Traverse the input string. When we get an opening parenthesis, we push it into the stack. When we get a closing parenthesis, we pop a parenthesis from the stack and check if itās the corresponding closing parenthesis.
-
We return
false
if there is a mismatch of ...