Cody

Solution 1848283

Submitted on 13 Jun 2019 by Marco Tullio
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   Pass
assert(isequal(balance_parens('(((()))((())))'),1))

cs = 1 2 3 4 3 2 1 2 3 4 3 2 1 0

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

cs = 1 2 1 2 1 2 1 0

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

cs = 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 0

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

cs = 1 2 1 2 1 2 1 0 -1 -2 -3

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

cs = 1 2 1 2 1 2 3 4 5 6 7 8 9 10 11 12 13 12 11 10 9 8

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

cs = -1 -2 -1 -2 -1 -2 -3

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

cs = 1 2 1 2 1 2 1 2 1 2 3 4 3 2 1 2 1 2 1 2 1 2 3 4 5 4 3 2 1 0

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

cs = 1 2 3 4 5 4 3 2 1 0