Cody

# Problem 80. Test for balanced parentheses

Solution 158113

Submitted on 6 Nov 2012
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
%% inStr = '()'; out_correct = true; assert(isequal(isBalanced(inStr),out_correct))

Error: You may not use the command(s) eval in your code

2   Fail
%% inStr = ')'; out_correct = false; assert(isequal(isBalanced(inStr),out_correct))

Error: You may not use the command(s) eval in your code

3   Fail
%% inStr = '(z*(a-(x+3))/(y))'; out_correct = true; assert(isequal(isBalanced(inStr),out_correct))

Error: You may not use the command(s) eval in your code

4   Fail
%% inStr = ')('; out_correct = false; assert(isequal(isBalanced(inStr),out_correct))

Error: You may not use the command(s) eval in your code

5   Fail
%% inStr = '(x)(x-y)'; out_correct = true; assert(isequal(isBalanced(inStr),out_correct))

Error: You may not use the command(s) eval in your code

6   Fail
%% inStr = ':-)'; out_correct = false; assert(isequal(isBalanced(inStr),out_correct))

Error: You may not use the command(s) eval in your code

7   Fail
%% inStr = ')()'; out_correct = false; assert(isequal(isBalanced(inStr),out_correct))

Error: You may not use the command(s) eval in your code

8   Fail
%% inStr = '(()'; out_correct = false; assert(isequal(isBalanced(inStr),out_correct))

Error: You may not use the command(s) eval in your code