Cody

Problem 45347. Cat's paw - 01

Solution 2192384

Submitted on 4 Apr 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
a={'meaw','meao-meao','mew'}; assert(isequal( cats_paw(a),'dgkswy'))

tiles = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' s = 5 ans = 'd' s = 12 ans = 'k' s = 13 ans = 'l'

Output argument "out" (and maybe others) not assigned during call to "cats_paw". Error in Test1 (line 2) assert(isequal( cats_paw(a),'dgkswy'))

2   Fail
a={'meaw','meao-meao','mew','meawww'} assert(isequal( cats_paw(a),'dgkswych'))

a = 1×4 cell array {'meaw'} {'meao-meao'} {'mew'} {'meawww'} tiles = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' s = 5 ans = 'd' s = 12 ans = 'k' s = 13 ans = 'l' s = 17 ans = 'p'

Output argument "out" (and maybe others) not assigned during call to "cats_paw". Error in Test2 (line 2) assert(isequal( cats_paw(a),'dgkswych'))

3   Fail
a={'mew','meawww','mew-mew-mew','meawwwww','meawww-mewaww-meaawwww'} assert(isequal( cats_paw(a),'dfjoscgnrm'))

a = 1×5 cell array {'mew'} {'meawww'} {'mew-mew-mew'} {'meawwwww'} {'meawww-mewaww-meaawwww'} tiles = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' s = 4 ans = 'c' s = 8 ans = 'g' s = 17 ans = 'p' s = 23 ans = 'v' s = 43 ans = 'p'

Output argument "out" (and maybe others) not assigned during call to "cats_paw". Error in Test3 (line 2) assert(isequal( cats_paw(a),'dfjoscgnrm'))

4   Pass
%a={''}; %assert( isempty(cats_paw(a)))

5   Fail
a={'meaw','','meao-meao','mew','meawww'} assert(isequal( cats_paw(a),'dgkswych'))

a = 1×5 cell array {'meaw'} {0×0 char} {'meao-meao'} {'mew'} {'meawww'} tiles = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' s = 5 ans = 'd' s = 3 ans = 'b' s = 10 ans = 'i' s = 11 ans = 'j' s = 15 ans = 'n'

Output argument "out" (and maybe others) not assigned during call to "cats_paw". Error in Test5 (line 2) assert(isequal( cats_paw(a),'dgkswych'))

6   Fail
a={'meawwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww'} assert(isequal( cats_paw(a),'de'))

a = 1×1 cell array {'meawwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww'} tiles = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' s = 55 ans = 'b'

Output argument "out" (and maybe others) not assigned during call to "cats_paw". Error in Test6 (line 2) assert(isequal( cats_paw(a),'de'))

7   Fail
a={'meaw','meao-meao','mew','','','','meawww',''} assert(isequal( cats_paw(a),'dgkswych'))

a = 1×8 cell array {'meaw'} {'meao-meao'} {'mew'} {0×0 char} {0×0 char} {0×0 char} {'meawww'} {0×0 char} tiles = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' s = 5 ans = 'd' s = 12 ans = 'k' s = 13 ans = 'l' s = 11 ans = 'j' s = 9 ans = 'h' s = 7 ans = 'f' s = 11 ans = 'j' s = 9 ans = 'h'

Output argument "out" (and maybe others) not assigned during call to "cats_paw". Error in Test7 (line 2) assert(isequal( cats_paw(a),'dgkswych'))

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!