Cody

# Problem 2512. longest common semi-substring

Solution 1536351

Submitted on 22 May 2018 by Srishti Saha
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
a = 'cat'; b = 'cat' y_correct = 3; assert(isequal(str(a,b),y_correct))

b = 'cat' ans = 3

2   Pass
a = 'cat'; b = 'cut' y_correct = 3; assert(isequal(str(a,b),y_correct))

b = 'cut' ans = 3

3   Pass
a = 'president'; b = 'precedent' y_correct = 9; assert(isequal(str(a,b),y_correct))

b = 'precedent' ans = 9

4   Pass
a = 'katy perry'; b = 'qqa^%^%rrrrRR' y_correct = 8; assert(isequal(str(a,b),y_correct))

b = 'qqa^%^%rrrrRR' ans = 8

5   Pass
a = 'cody was down for a while'; b = '12w123456789o88888888899' y_correct = 11; assert(isequal(str(a,b),y_correct))

b = '12w123456789o88888888899' ans = 11

6   Pass
a = 'cat'; b = 'dog and other pets' y_correct = 1; assert(isequal(str(a,b),y_correct))

b = 'dog and other pets' ans = 1

7   Pass
a = 'cat'; b = 'aca' y_correct = 2; assert(isequal(str(a,b),y_correct))

b = 'aca' ans = 2

8   Pass
a = 'apparently nothing in common'; b = 'zzzz zz zzzz' y_correct = 4; assert(isequal(str(a,b),y_correct))

b = 'zzzz zz zzzz' ans = 4

9   Pass
a = 'nothing in common'; b = 'zzzz' y_correct = 0; assert(isequal(str(a,b),y_correct))

b = 'zzzz' ans = 0

10   Pass
a = 'empty string testing'; b = ''; y_correct = 0; assert(isequal(str(a,b),y_correct))

ans = 0

11   Pass
a = ''; b = ''; y_correct = 0; assert(isequal(str(a,b),y_correct))

ans = 0