Cody

Solution 1801664

Submitted on 30 Apr 2019 by Tim
  • Size: 10
  • This is the leading solution.
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   Pass
% Generate and test 100 random binary expressions. operators = '+-*'; for k = 1:100 a = randi(101) - 51; b = randi(101) - 51; op = operators(randi(numel(operators))); expr = sprintf('%d %1s %d', a, op, b); y_correct = eval(expr); assert(isequal(parse_binary_expression(expr),y_correct)) end