Cody

Solution 1065563

Submitted on 28 Nov 2016 by goc3
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 ;)')

ans = 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 ;)')

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