Cody

# Problem 1303. Is the paranthesis sequence balanced ?

Solution 2473670

Submitted on 4 Jun 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
assert(isequal(balance_parens('(((()))((())))'),1))

Undefined function 'balance_parens' for input arguments of type 'char'. Error in Test1 (line 1) assert(isequal(balance_parens('(((()))((())))'),1))

2   Fail
assert(isequal(balance_parens('(()()())'),1))

Undefined function 'balance_parens' for input arguments of type 'char'. Error in Test2 (line 1) assert(isequal(balance_parens('(()()())'),1))

3   Fail
assert(isequal(balance_parens(['(()()()()()()()()()()()())']),1))

Undefined function 'balance_parens' for input arguments of type 'char'. Error in Test3 (line 1) assert(isequal(balance_parens(['(()()()()()()()()()()()())']),1))

4   Fail
assert(isequal(balance_parens('(()()()))))'),0))

Undefined function 'balance_parens' for input arguments of type 'char'. Error in Test4 (line 1) assert(isequal(balance_parens('(()()()))))'),0))

5   Fail
assert(isequal(balance_parens('(()()(((((((((((()))))'),0))

Undefined function 'balance_parens' for input arguments of type 'char'. Error in Test5 (line 1) assert(isequal(balance_parens('(()()(((((((((((()))))'),0))

6   Fail
assert(isequal(balance_parens('))()())'),0))

Undefined function 'balance_parens' for input arguments of type 'char'. Error in Test6 (line 1) assert(isequal(balance_parens('))()())'),0))

7   Fail
assert(isequal(balance_parens('(()()()()((()))()()()(((()))))'),1))

Undefined function 'balance_parens' for input arguments of type 'char'. Error in Test7 (line 1) assert(isequal(balance_parens('(()()()()((()))()()()(((()))))'),1))

8   Fail
assert(isequal(balance_parens('((((()))))'),1))

Undefined function 'balance_parens' for input arguments of type 'char'. Error in Test8 (line 1) assert(isequal(balance_parens('((((()))))'),1))