Cody

# Problem 594. "Look and say" sequence

Solution 2392704

Submitted on 27 May 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(look_and_say([1]),[1 1]))

Array indices must be positive integers or logical values. Error in look_and_say (line 12) if SEED(end-1)~=SEED(end) Error in Test1 (line 1) assert(isequal(look_and_say([1]),[1 1]))

2   Fail
assert(isequal(look_and_say([1 1 1 1 1]),[5 1]))

Unrecognized function or variable 'c'. Error in look_and_say (line 15) NEXT=[NEXT c]; Error in Test2 (line 1) assert(isequal(look_and_say([1 1 1 1 1]),[5 1]))

3   Fail
assert(isequal(look_and_say([1 3 3 1 5 2 2]),[1 1 2 3 1 1 1 5 2 2]))

Unrecognized function or variable 'c'. Error in look_and_say (line 15) NEXT=[NEXT c]; Error in Test3 (line 1) assert(isequal(look_and_say([1 3 3 1 5 2 2]),[1 1 2 3 1 1 1 5 2 2]))

4   Pass
assert(isequal(look_and_say([8 6 7 5 3 0 9]),[1 8 1 6 1 7 1 5 1 3 1 0 1 9]))