Cody

Problem 2469. Cat, Meowcat and Concatenation

Solution 2699825

Submitted on 16 Jul 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   Pass
x = {'cat','meowcat','concatenation'}; y_correct = 'cat'; assert(isequal(commonS(x),y_correct))

2   Fail
x = {'zzzyyyzzz','meowcat','concatenation'}; y_correct = ''; assert(isequal(commonS(x),y_correct))

Assertion failed.

3   Fail
x = {'meowcat','owl','bowl'}; y_correct = 'ow'; assert(isequal(commonS(x),y_correct))

Index exceeds the number of array elements (2). Error in commonS (line 6) y=y(shapeID); Error in Test3 (line 3) assert(isequal(commonS(x),y_correct))

4   Fail
x = {'adoga','ssdogss','ppdogppp'}; y_correct = 'dog'; assert(isequal(commonS(x),y_correct))

Index exceeds the number of array elements (3). Error in commonS (line 6) y=y(shapeID); Error in Test4 (line 3) assert(isequal(commonS(x),y_correct))