Cody

Problem 42283. Look and say Conway's sequence

Solution 3354583

Submitted on 24 Oct 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
seed = 1; n=5; y_correct = {'1';'11';'21';'1211';'111221'}; assert(isequal(lasnumber(seed,n),y_correct))

Unrecognized function or variable 'x'. Error in lasnumber (line 2) serie = x; Error in Test1 (line 3) assert(isequal(lasnumber(seed,n),y_correct))

2   Fail
seed = 4; n=10; y_correct = {'4';'14';'1114';'3114';'132114';'1113122114';'311311222114';'13211321322114';'1113122113121113222114';'31131122211311123113322114'}; assert(isequal(lasnumber(seed,n),y_correct))

Unrecognized function or variable 'x'. Error in lasnumber (line 2) serie = x; Error in Test2 (line 3) assert(isequal(lasnumber(seed,n),y_correct))

3   Fail
seed = 22; n=5; y_correct = {'22';'22';'22';'22';'22'} assert(isequal(lasnumber(seed,n),y_correct))

y_correct = 5×1 cell array {'22'} {'22'} {'22'} {'22'} {'22'}

Unrecognized function or variable 'x'. Error in lasnumber (line 2) serie = x; Error in Test3 (line 3) assert(isequal(lasnumber(seed,n),y_correct))

Suggested Problems

More from this Author2

Community Treasure Hunt

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

Start Hunting!