Cody

# Problem 2523. longest common substring : Skipped character version

Solution 1950580

Submitted on 27 Sep 2019 by Nikolaos Nikolaou
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))

a = 0.5000 b = 4 y = 'abcd'

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

a = 0 b = 0 y = 0×0 empty char array

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

a = 1 b = 9 y = 'catcatcat'

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

a = 0.7727 b = 17 y = ' example a strin'

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

a = 0.2105 b = 4 y = ' '

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

a = 0.1579 b = 3 y = '!!!'