Cody

Problem 2523. longest common substring : Skipped character version

Solution 548002

Submitted on 19 Dec 2014
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
%% str1 = 'abcdefghi'; str2 = 'zazbzczd'; y_correct = 'abcd'; assert(isequal(skipped(str1,str2),y_correct))

Error: Output argument "common2" (and maybe others) not assigned during call to "/users/msssystem1/skipped.m>skipped".

2   Fail
%% str1 = 'abcdefghi'; str2 = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'; y_correct = ''; assert(isequal(skipped(str1,str2),y_correct))

Error: Output argument "common2" (and maybe others) not assigned during call to "/users/msssystem1/skipped.m>skipped".

3   Fail
%% str1 = 'catcatcat'; str2 = 'catcatcat'; y_correct = str1; assert(isequal(skipped(str1,str2),y_correct))

Error: Output argument "common2" (and maybe others) not assigned during call to "/users/msssystem1/skipped.m>skipped".

4   Fail
%% str1 = 'an example of a string'; str2 = 'the example z a s t r i i i n ssss'; y_correct = ' example a strin'; assert(isequal(skipped(str1,str2),y_correct))

Error: Output argument "common2" (and maybe others) not assigned during call to "/users/msssystem1/skipped.m>skipped".

5   Fail
%% str1 = 'a string with many characters'; str2 = 'zzz zzz zzz zzz zzz'; y_correct = ' '; assert(isequal(skipped(str1,str2),y_correct))

Error: Output argument "common2" (and maybe others) not assigned during call to "/users/msssystem1/skipped.m>skipped".

6   Fail
%% str1 = 'lets!not!use!spaces'; str2 = 'z!zzzzzzzzZZZzZzZ!zzzzz!zzzzzzzzz!!!!!!!!!zzz'; y_correct = '!!!'; assert(isequal(skipped(str1,str2),y_correct))

Error: Output argument "common2" (and maybe others) not assigned during call to "/users/msssystem1/skipped.m>skipped".