Cody

Problem 2643. Find out base of following arithmetic operation

Solution 2690294

Submitted on 14 Jul 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
x = '41/3=13'; y_correct = 8; assert(isequal(base_exp(x),y_correct))

Error in solution: Line: 2 Column: 2 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

2   Fail
x = '23+44+14+32=223'; y_correct = 5; assert(isequal(base_exp(x),y_correct))

Error in solution: Line: 2 Column: 2 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

3   Fail
x = '41^(1/2)=5'; y_correct = 6; assert(isequal(base_exp(x),y_correct))

Error in solution: Line: 2 Column: 2 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

4   Fail
x = '302/20=12.1'; y_correct = 4; assert(isequal(base_exp(x),y_correct))

Error in solution: Line: 2 Column: 2 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

5   Fail
x = '6*9=42'; y_correct = 13; assert(isequal(base_exp(x),y_correct))

Error in solution: Line: 2 Column: 2 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.