Cody

# Problem 466. Compress strings (not springs)

Solution 3068269

Submitted on 5 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
x='Blogs , Trendy , Cody , Contest .'; y='Blogs, Trendy, Cody, Contest.'; assert(isequal(cozy_cody(x),y))

y = 1×1 cell array {'Blogs , Trendy , Cody , Contest.'} y = 1×1 cell array {'Blogs , Trendy , Cody , Contest.'} y = 1×1 cell array {'Blogs , Trendy , Cody , Contest.'}

Assertion failed.

2   Fail
x='Trendy , Cody , Contest .'; y='Trendy, Cody, Contest.'; assert(isequal(cozy_cody(x),y))

y = 1×1 cell array {'Trendy , Cody , Contest.'} y = 1×1 cell array {'Trendy, Cody, Contest.'} y = 1×1 cell array {'Trendy, Cody, Contest.'}

Assertion failed.

3   Fail
x='One Two Three Four Five Six Seven Eight Nine Ten'; y='One Two Three Four Five Six Seven Eight Nine Ten'; assert(isequal(cozy_cody(x),y))

y = 1×1 cell array {'One Two Three Four Five Six Seven Eight Nine Ten'} y = 1×1 cell array {'One Two Three Four Five Six Seven Eight Nine Ten'} y = 1×1 cell array {'One Two Three Four Five Six Seven Eight Nine Ten'}

Assertion failed.

4   Fail
x='1, 2, 3, 4, 5, 6, 7, 8, 9, 10'; y='1, 2, 3, 4, 5, 6, 7, 8, 9, 10'; assert(isequal(cozy_cody(x),y))

y = 1×1 cell array {'1, 2, 3, 4, 5, 6, 7, 8, 9, 10'} y = 1×1 cell array {'1, 2, 3, 4, 5, 6, 7, 8, 9, 10'} y = 1×1 cell array {'1, 2, 3, 4, 5, 6, 7, 8, 9, 10'}

Assertion failed.

5   Fail
x='1 , and 3 , and 7 , and 12'; y='1, and 3, and 7, and 12'; assert(isequal(cozy_cody(x),y))

y = 1×1 cell array {'1 , and 3 , and 7 , and 12'} y = 1×1 cell array {'1 , and 3 , and 7, and 12'} y = 1×1 cell array {'1 , and 3 , and 7, and 12'}

Assertion failed.

6   Fail
x='Hello There !'; y='Hello There!'; assert(isequal(cozy_cody(x),y))

y = 1×1 cell array {'Hello There !'} y = 1×1 cell array {'Hello There !'} y = 1×1 cell array {'Hello There !'}

Assertion failed.

### Community Treasure Hunt

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

Start Hunting!