Cody

Problem 45352. Number generator

Solution 2171305

Submitted on 23 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
assert(isequal(number_gen(74562),168))

num = 7 4 5 6 2 s = 7

Index exceeds the number of array elements (2). Error in number_gen (line 13) s = num(i+1); Error in Test1 (line 1) assert(isequal(number_gen(74562),168))

2   Fail
assert(isequal(number_gen(74561562),16713))

num = 7 4 5 6 1 5 6 2 s = 7

Index exceeds the number of array elements (1). Error in number_gen (line 13) s = num(i+1); Error in Test2 (line 1) assert(isequal(number_gen(74561562),16713))

3   Fail
assert(isequal(number_gen(111111111111),222222))

num = 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 ass = 2 2 2 2 2 2 2 2 2 2

Output argument "y" (and maybe others) not assigned during call to "number_gen". Error in Test3 (line 1) assert(isequal(number_gen(111111111111),222222))

4   Fail
assert(isequal(number_gen(1111111111111),2222221))

num = 1 1 1 1 1 1 1 1 1 1 1 1 1 s = 1 ass = 2 2 2 2 2 2 2 2 2 2

Output argument "y" (and maybe others) not assigned during call to "number_gen". Error in Test4 (line 1) assert(isequal(number_gen(1111111111111),2222221))

5   Fail
assert(isequal(number_gen(3456696524532), 122111115))

num = 3 4 5 6 6 9 6 5 2 4 5 3 2 s = 3

Index exceeds the number of array elements (2). Error in number_gen (line 13) s = num(i+1); Error in Test5 (line 1) assert(isequal(number_gen(3456696524532), 122111115))

6   Fail
assert(isequal(number_gen(100000024008),15))

num = 1 0 0 0 0 0 0 2 4 0 0 8 s = 1 ass = 2 0 0 0 0 0 2 6 4 0

Output argument "y" (and maybe others) not assigned during call to "number_gen". Error in Test6 (line 1) assert(isequal(number_gen(100000024008),15))

7   Fail
assert(isequal(number_gen(288624888862),70))

num = 2 8 8 6 2 4 8 8 8 8 6 2 s = 2 ass = 4 16 14 8 6 12 16 16 16 14

Output argument "y" (and maybe others) not assigned during call to "number_gen". Error in Test7 (line 1) assert(isequal(number_gen(288624888862),70))

Suggested Problems

More from this Author148