Cody

Problem 2523. longest common substring : Skipped character version

Solution 3025198

Submitted on 2 Oct 2020 by Augusto Mazzei
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
str1 = 'abcdefghi'; str2 = 'zazbzczd'; y_correct = 'abcd'; assert(isequal(skipped(str1,str2),y_correct))

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

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

4   Pass
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))

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

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

Community Treasure Hunt

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

Start Hunting!