Cody

# Problem 594. "Look and say" sequence

Solution 1885426

Submitted on 27 Jul 2019 by Nikolaos Nikolaou
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]))

t1 = [] t2 = [] N = 1 1

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

t1 = 1 2 3 4 t2 = 1 2 3 N = 5 1

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

t1 = 2 6 t2 = [] N = 1 1 N = 1 1 1 3 N = 1 1 1 3 1 1 N = 1 1 1 3 1 1 1 5 N = 1 1 1 3 1 1 1 5 1 2 N = 1 1 2 3 1 1 1 5 1 2 N = 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]))

t1 = 1×0 empty double row vector t2 = 1×0 empty double row vector N = 1 8 N = 1 8 1 6 N = 1 8 1 6 1 7 N = 1 8 1 6 1 7 1 5 N = 1 8 1 6 1 7 1 5 1 3 N = 1 8 1 6 1 7 1 5 1 3 1 0 N = 1 8 1 6 1 7 1 5 1 3 1 0 1 9

### Community Treasure Hunt

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

Start Hunting!