Problem 42296. String math

Solution 667870

Submitted on 8 May 2015 by Alfonso Nieto-Castanon
  • Size: 15
  • 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
%% assert(isequal(string_math('one'),false))

2   Pass
%% assert(isequal(string_math('four'),true))

3   Pass
%% assert(isequal(string_math('nine divided by one times three plus six'),true))

4   Pass
%% assert(isequal(string_math('nine divided by one multiplied by three plus six'),false))

5   Pass
%% assert(isequal(string_math('six plus nine times six divided by two plus five'),false))

6   Pass
%% assert(isequal(string_math('seven minus nine plus eight times five plus eight plus two'),true))

7   Pass
%% assert(isequal(string_math('nine plus six multiplied by three plus nine'),true))

8   Pass
%% assert(isequal(string_math('plus eight plus nine'),true))

Suggested Problems

More from this Author80

Community Treasure Hunt

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

Start Hunting!