Cody

# Problem 269. Find Rotated Substring

Solution 1900940

Submitted on 15 Aug 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
s1 = 'matlabcentral'; s2 = 'thecentralmatlab'; y_correct = true; assert(isequal(isRotatedStrPresent(s1,s2),y_correct))

p = 0 p = 0 0 p = 0 0 0 p = 0 0 0 0 p = 0 0 0 0 0 p = 0 0 0 0 0 0 p = 0 0 0 0 0 0 1 p = 0 0 0 0 0 0 1 0 p = 0 0 0 0 0 0 1 0 0 p = 0 0 0 0 0 0 1 0 0 0 p = 0 0 0 0 0 0 1 0 0 0 0 p = 0 0 0 0 0 0 1 0 0 0 0 0 p = 0 0 0 0 0 0 1 0 0 0 0 0 0 y = logical 1

2   Pass
s1 = 'altabcentralm'; s2 = 'thecentralmatlab'; y_correct = false; assert(isequal(isRotatedStrPresent(s1,s2),y_correct))

p = 0 p = 0 0 p = 0 0 0 p = 0 0 0 0 p = 0 0 0 0 0 p = 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 0 0 0 0 y = logical 0

3   Pass
s1 = 'cooldrinks'; s2 = 'somecoolerdrinks'; y_correct = false; assert(isequal(isRotatedStrPresent(s1,s2),y_correct))

p = 0 p = 0 0 p = 0 0 0 p = 0 0 0 0 p = 0 0 0 0 0 p = 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 0 y = logical 0

4   Pass
s1 = 'controlsystem'; s2 = 'asystemcontrol'; y_correct = true; assert(isequal(isRotatedStrPresent(s1,s2),y_correct))

p = 0 p = 0 0 p = 0 0 0 p = 0 0 0 0 p = 0 0 0 0 0 p = 0 0 0 0 0 1 p = 0 0 0 0 0 1 0 p = 0 0 0 0 0 1 0 0 p = 0 0 0 0 0 1 0 0 0 p = 0 0 0 0 0 1 0 0 0 0 p = 0 0 0 0 0 1 0 0 0 0 0 p = 0 0 0 0 0 1 0 0 0 0 0 0 p = 0 0 0 0 0 1 0 0 0 0 0 0 0 y = logical 1

5   Pass
s1 = 'controlsystem'; s2 = 'contorlsystem'; y_correct = false; assert(isequal(isRotatedStrPresent(s1,s2),y_correct))

p = 0 p = 0 0 p = 0 0 0 p = 0 0 0 0 p = 0 0 0 0 0 p = 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 0 0 0 p = 0 0 0 0 0 0 0 0 0 0 0 0 0 y = logical 0