can be solved without 'regexp'
A slightly more robust test might include a balanced equation starting with something other than an opening bracket.
Test 3 might be
inStr = '3*(z*(a-(x+3))/(y))';
Wrong solution.
it doesn't work in some cases not included in test suite. for example:
inStr = '(z*(a-(x+3))/(y)*z)';
Nice solution
Seems to fail for inStr='(' , '((', etc.
I admit this is cheating, but I think it also stresses the need for more tests in the suite. Also, not all the cases should necessarily be visible, so you can't adapt a solution like this.
This solution fails for the input ')()', i.e. it returns true when it should return false.
This solution fails for the input '(()', i.e. it returns true when it should return false.
This solution fails for the input '(()', i.e. it returns true when it should return false.
This entry is incorrect. It fails the simple case of:
isBalanced('(')
Back to basics 11 - Max Integer
678 Solvers
725 Solvers
Matrix which contains the values of an other matrix A at the given locations.
214 Solvers
Determine the number of odd integers in a vector
435 Solvers
664 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!