Cody

Problem 45296. Ugly numbers - 01

Solution 2169820

Submitted on 22 Mar 2020
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   Fail
n = 1; y_correct = 1; assert(isequal(ugly(n),y_correct))

s = Columns 1 through 29 2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 27 30 32 36 40 45 48 50 54 60 64 72 75 80 Columns 30 through 50 81 90 96 100 108 120 125 128 135 144 150 160 162 180 192 200 216 225 240 243 250

Output argument "y" (and maybe others) not assigned during call to "ugly". Error in Test1 (line 3) assert(isequal(ugly(n),y_correct))

2   Fail
n = 20; y_correct = 36; assert(isequal(ugly(n),y_correct))

s = Columns 1 through 29 2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 27 30 32 36 40 45 48 50 54 60 64 72 75 80 Columns 30 through 50 81 90 96 100 108 120 125 128 135 144 150 160 162 180 192 200 216 225 240 243 250

Output argument "y" (and maybe others) not assigned during call to "ugly". Error in Test2 (line 3) assert(isequal(ugly(n),y_correct))

3   Fail
n = 200; y_correct = 16200; assert(isequal(ugly(n),y_correct))

s = Columns 1 through 29 2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 27 30 32 36 40 45 48 50 54 60 64 72 75 80 Columns 30 through 50 81 90 96 100 108 120 125 128 135 144 150 160 162 180 192 200 216 225 240 243 250

Output argument "y" (and maybe others) not assigned during call to "ugly". Error in Test3 (line 3) assert(isequal(ugly(n),y_correct))

4   Fail
n = 100; y_correct = 1536; assert(isequal(ugly(n),y_correct))

s = Columns 1 through 29 2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 27 30 32 36 40 45 48 50 54 60 64 72 75 80 Columns 30 through 50 81 90 96 100 108 120 125 128 135 144 150 160 162 180 192 200 216 225 240 243 250

Output argument "y" (and maybe others) not assigned during call to "ugly". Error in Test4 (line 3) assert(isequal(ugly(n),y_correct))

5   Fail
n = 250; y_correct = 38880; assert(isequal(ugly(n),y_correct))

s = Columns 1 through 29 2 3 4 5 6 8 9 10 12 15 16 18 20 24 25 27 30 32 36 40 45 48 50 54 60 64 72 75 80 Columns 30 through 50 81 90 96 100 108 120 125 128 135 144 150 160 162 180 192 200 216 225 240 243 250

Output argument "y" (and maybe others) not assigned during call to "ugly". Error in Test5 (line 3) assert(isequal(ugly(n),y_correct))