Cody

# Problem 594. "Look and say" sequence

Solution 1591004

Submitted on 24 Jul 2018 by Alexander
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   Pass
assert(isequal(look_and_say([1]),[1 1]))

ind = 1 y = 1 1 x = 1×0 empty double row vector

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

ind = 5 y = 5 1 x = 1×0 empty double row vector

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

ind = 1 y = 1 1 x = 3 3 1 5 2 2 ind = 2 y = 1 1 2 3 x = 1 5 2 2 ind = 1 y = 1 1 2 3 1 1 x = 5 2 2 ind = 1 y = 1 1 2 3 1 1 1 5 x = 2 2 ind = 2 y = 1 1 2 3 1 1 1 5 2 2 x = 1×0 empty double row vector

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

ind = 1 y = 1 8 x = 6 7 5 3 0 9 ind = 1 y = 1 8 1 6 x = 7 5 3 0 9 ind = 1 y = 1 8 1 6 1 7 x = 5 3 0 9 ind = 1 y = 1 8 1 6 1 7 1 5 x = 3 0 9 ind = 1 y = 1 8 1 6 1 7 1 5 1 3 x = 0 9 ind = 1 y = 1 8 1 6 1 7 1 5 1 3 1 0 x = 9 ind = 1 y = 1 8 1 6 1 7 1 5 1 3 1 0 1 9 x = 1×0 empty double row vector