Cody

# Problem 1477. Champernowne Constant

Solution 3638548

Submitted on 12 Nov 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
x = [1 2 3 4 5]; y_correct = [1 2 3 4 5]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 1

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test1 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

2   Fail
x = [10 11 12 13 14 15]; y_correct = [1 0 1 1 1 2]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 2 ans = 9

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test2 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

3   Fail
x = [188 189]; y_correct = [9 9]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 3 ans = 9 ans = 180

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test3 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

4   Fail
x = 2887:3000; y_correct = '999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102'; assert(isequal(sprintf('%d',gendigit_champernowne(2887:3000)),y_correct))

t = 4 ans = 9 ans = 180 ans = 2700

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test4 (line 3) assert(isequal(sprintf('%d',gendigit_champernowne(2887:3000)),y_correct))

5   Fail
x=[1000000 1000001 1000002]; y_correct = [1 8 5]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 7 ans = 9 ans = 180 ans = 2700 ans = 36000 ans = 450000 ans = 5400000

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test5 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

6   Fail
x=[12000:12005]; y_correct = [7 7 3 2 7 8]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 5 ans = 9 ans = 180 ans = 2700 ans = 36000

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test6 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

7   Fail
x=[10000000 10000001 10000002]; y_correct = [7 3 0]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 8 ans = 9 ans = 180 ans = 2700 ans = 36000 ans = 450000 ans = 5400000 ans = 63000000

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test7 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

8   Fail
x=[120000:120005]; y_correct = [2 6 2 2 2 2]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 6 ans = 9 ans = 180 ans = 2700 ans = 36000 ans = 450000

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test8 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

9   Fail
x=[1200000:1200005]; y_correct = [ 8 5 1 8 2 1]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 7 ans = 9 ans = 180 ans = 2700 ans = 36000 ans = 450000 ans = 5400000

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test9 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

10   Fail
x=[1200004:1200009]; y_correct = [ 2 1 8 5 1 9]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 7 ans = 9 ans = 180 ans = 2700 ans = 36000 ans = 450000 ans = 5400000

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test10 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

11   Fail
x=[1200008:1200013]; y_correct = [1 9 2 1 8 5]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 7 ans = 9 ans = 180 ans = 2700 ans = 36000 ans = 450000 ans = 5400000

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test11 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

12   Fail
x=[13000008:13000013]; y_correct = [2 0 1 5 8 7]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 8 ans = 9 ans = 180 ans = 2700 ans = 36000 ans = 450000 ans = 5400000 ans = 63000000

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test12 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

13   Fail
x=[14000008:14000013]; y_correct = [ 1 5 8 7 3 1]; assert(isequal(gendigit_champernowne(x),y_correct))

t = 8 ans = 9 ans = 180 ans = 2700 ans = 36000 ans = 450000 ans = 5400000 ans = 63000000

Output argument "vy" (and maybe others) not assigned during call to "gendigit_champernowne". Error in Test13 (line 3) assert(isequal(gendigit_champernowne(x),y_correct))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!