Write a program to say whether a string is a rotation of another
Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1. example if S1=ABCD then BCDA,CDAB etc are rotations of S1.
Just another WordPress weblog
Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1. example if S1=ABCD then BCDA,CDAB etc are rotations of S1.
check
1. S1 and S2 are of same length
2. S1 is in S2S2