MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Correct

81Size

Leading solution size is 10.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test

Code Input and Output

1

Pass

%% assert(isequal(balance('(((()))((())))'),1)) assert(isequal(balance('(()()())'),1)) assert(isequal(balance(['(()()()()()()()()()()()())']),1)) assert(isequal(balance('(()()()))))'),0)) assert(isequal(balance('(()()(((((((((((()))))'),0)) assert(isequal(balance('))()())'),0)) assert(isequal(balance('(()()()()((()))()()()(((()))))'),1)) assert(isequal(balance('((((()))))'),1))

x = (((()))((XX))) x = (((()))(XXXX)) x = (((()))XXXXXX) x = (((XX))XXXXXX) x = ((XXXX)XXXXXX) x = (XXXXXXXXXXXX) x = XXXXXXXXXXXXXX x = (()()XX) x = (()XXXX) x = (XXXXXX) x = XXXXXXXX x = (()()()()()()()()()()()XX) x = (()()()()()()()()()()XXXX) x = (()()()()()()()()()XXXXXX) x = (()()()()()()()()XXXXXXXX) x = (()()()()()()()XXXXXXXXXX) x = (()()()()()()XXXXXXXXXXXX) x = (()()()()()XXXXXXXXXXXXXX) x = (()()()()XXXXXXXXXXXXXXXX) x = (()()()XXXXXXXXXXXXXXXXXX) x = (()()XXXXXXXXXXXXXXXXXXXX) x = (()XXXXXXXXXXXXXXXXXXXXXX) x = (XXXXXXXXXXXXXXXXXXXXXXXX) x = XXXXXXXXXXXXXXXXXXXXXXXXXX x = (()()XX)))) x = (()XXXX)))) x = (XXXXXX)))) x = XXXXXXXX))) x = (()()(((((((((((XX)))) x = (()()((((((((((XXXX))) x = (()()(((((((((XXXXXX)) x = (()()((((((((XXXXXXXX) x = (()()(((((((XXXXXXXXXX x = ))()XX) x = ))XXXX) x = (()()()()((()))()()()(((XX)))) x = (()()()()((()))()()()((XXXX))) x = (()()()()((()))()()()(XXXXXX)) x = (()()()()((()))()()()XXXXXXXX) x = (()()()()((()))()()XXXXXXXXXX) x = (()()()()((()))()XXXXXXXXXXXX) x = (()()()()((()))XXXXXXXXXXXXXX) x = (()()()()((XX))XXXXXXXXXXXXXX) x = (()()()()(XXXX)XXXXXXXXXXXXXX) x = (()()()()XXXXXXXXXXXXXXXXXXXX) x = (()()()XXXXXXXXXXXXXXXXXXXXXX) x = (()()XXXXXXXXXXXXXXXXXXXXXXXX) x = (()XXXXXXXXXXXXXXXXXXXXXXXXXX) x = (XXXXXXXXXXXXXXXXXXXXXXXXXXXX) x = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX x = ((((XX)))) x = (((XXXX))) x = ((XXXXXX)) x = (XXXXXXXX) x = XXXXXXXXXX