Cody

# Problem 80. Test for balanced parentheses

Solution 2618044

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

Error in solution: Line: 5 Column: 15 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.

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

Error in solution: Line: 5 Column: 15 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.

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

Error in solution: Line: 5 Column: 15 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.

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

Error in solution: Line: 5 Column: 15 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.

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

Error in solution: Line: 5 Column: 15 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.

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

Error in solution: Line: 5 Column: 15 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.

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

Error in solution: Line: 5 Column: 15 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.

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

Error in solution: Line: 5 Column: 15 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!