Cody

Problem 1871. Numbers in extended form

Solution 1764539

Submitted on 27 Mar 2019 by Abdelfatah Teamah
• Size: 7
• 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
x = 10234; y_correct = '10000+200+30+4'; assert(strcmp(extended_form(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In extended_form (line 2) In ScoringEngineTestPoint1 (line 3) In solutionTest (line 5)]

2   Pass
x=987654321; y_correct='900000000+80000000+7000000+600000+50000+4000+300+20+1'; assert(strcmp(extended_form(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In extended_form (line 2) In ScoringEngineTestPoint2 (line 3) In solutionTest (line 7)]

3   Pass
x = 1000; y_correct = '1000'; assert(strcmp(extended_form(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In extended_form (line 2) In ScoringEngineTestPoint3 (line 3) In solutionTest (line 9)]

4   Pass
x = 314159265358979; y_correct = '300000000000000+10000000000000+4000000000000+100000000000+50000000000+9000000000+200000000+60000000+5000000+300000+50000+8000+900+70+9'; assert(strcmp(extended_form(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In extended_form (line 2) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 11)]

5   Pass
x=540200; y_correct='500000+40000+200'; assert(strcmp(extended_form(x),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In extended_form (line 2) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 13)]