Given a string s1, find if a rotated version of s1 is present in a second string s2.
For example, rotated version of some strings are:
"matlabcentral" => "atlabcentralm" => .. => "centralmatlab" etc.
So, if
s1 = 'matlabcentral';
s2 = 'thecentralmatlab';
then the result is true.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers242
Suggested Problems
-
Project Euler: Problem 5, Smallest multiple
1651 Solvers
-
What is the distance from point P(x,y) to the line Ax + By + C = 0?
560 Solvers
-
Back to basics 25 - Valid variable names
339 Solvers
-
Square Digits Number Chain Terminal Value (Inspired by Project Euler Problem 92)
256 Solvers
-
Solve a System of Linear Equations
14399 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
the last test case fails due to an incorrect call of the function. also, could you stick %% between each of the test cases so that they show up as separate?
The function circshift is useful!