Cody

# Problem 2699. From a given cell array of strings, extract the non-unique strings.

Solution 2108758

Submitted on 28 Jan 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
C = {'Ken'; 'GianCarlo'; 'Ken'; 'GianCarlo'; 'Bob'; 'Ken'; 'Sonia'}; repeatedStrings = {'Ken'; 'GianCarlo'}; assert(isequal(extractRepeatedStrings(C), repeatedStrings))

Undefined function 'countmember' for input arguments of type 'cell'. Error in extractRepeatedStrings (line 3) a=countmember(C,C) Error in Test1 (line 3) assert(isequal(extractRepeatedStrings(C), repeatedStrings))

2   Fail
C = {'A', 'B', 'C', 'A', 'B'}; repeatedStrings = {'A'; 'B'}; assert(isequal(extractRepeatedStrings(C), repeatedStrings))

Undefined function 'countmember' for input arguments of type 'cell'. Error in extractRepeatedStrings (line 3) a=countmember(C,C) Error in Test2 (line 3) assert(isequal(extractRepeatedStrings(C), repeatedStrings))

3   Fail
C = {'B', 'A', 'C', 'B', 'A'}; repeatedStrings = {'B'; 'A'}; assert(isequal(extractRepeatedStrings(C), repeatedStrings))

Undefined function 'countmember' for input arguments of type 'cell'. Error in extractRepeatedStrings (line 3) a=countmember(C,C) Error in Test3 (line 3) assert(isequal(extractRepeatedStrings(C), repeatedStrings))

4   Fail
C = {'A', 'B', 'C'}; repeatedStrings = cell.empty(0, 1); assert(isequal(extractRepeatedStrings(C), repeatedStrings))

Undefined function 'countmember' for input arguments of type 'cell'. Error in extractRepeatedStrings (line 3) a=countmember(C,C) Error in Test4 (line 3) assert(isequal(extractRepeatedStrings(C), repeatedStrings))

5   Fail
C = {'A', 'B'; 'C', 'A'; 'B', 'A'}; repeatedStrings = {'A'; 'B'}; assert(isequal(extractRepeatedStrings(C), repeatedStrings))

Undefined function 'countmember' for input arguments of type 'cell'. Error in extractRepeatedStrings (line 3) a=countmember(C,C) Error in Test5 (line 3) assert(isequal(extractRepeatedStrings(C), repeatedStrings))