Cody

Problem 45296. Ugly numbers - 01

Solution 2169807

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))

ans = 1

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))

ans = 26

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))

Index exceeds the number of array elements (179). Error in ugly (line 21) s(n) Error in Test3 (line 3) assert(isequal(ugly(n),y_correct))

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

ans = 135

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))

Index exceeds the number of array elements (179). Error in ugly (line 21) s(n) Error in Test5 (line 3) assert(isequal(ugly(n),y_correct))