Cody

Solution 1997171

Submitted on 31 Oct 2019 by Nikolaos Nikolaou
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
f = '2(x + y)'; y = expandf(f); validatestring(y,{'2 ( x + y )'}) assert(isequal(y,'2 ( x + y )'),'Not that kind of expansion ;)')

y = " " y = " 2 " y = " 2 ( " y = " 2 ( x " y = " 2 ( x " y = " 2 ( x + " y = " 2 ( x + " y = " 2 ( x + y " y = " 2 ( x + y ) " y = "2 ( x + y )" ans = '2 ( x + y )'

2   Pass
f = '2(x + y + z)'; y = expandf(f); validatestring(y,{'2 ( x + y + z )'}) assert(isequal(y,'2 ( x + y + z )'),'Not that kind of expansion ;)')

y = " " y = " 2 " y = " 2 ( " y = " 2 ( x " y = " 2 ( x " y = " 2 ( x + " y = " 2 ( x + " y = " 2 ( x + y " y = " 2 ( x + y " y = " 2 ( x + y + " y = " 2 ( x + y + " y = " 2 ( x + y + z " y = " 2 ( x + y + z ) " y = "2 ( x + y + z )" ans = '2 ( x + y + z )'