DEV Community

unlimit
unlimit

Posted on

Balanced Parenthesis

How can a generic program be implemented in JavaScript to find and return the number of unbalanced parentheses in a given string?

input1: '()))' output1: 2
input2: '(())' output2: 0
input3: '))((' output3: 4

Solution:
The solution is:
Code for balanced parenthesis

Top comments (0)