Created
August 4, 2019 16:24
-
-
Save sakhayadeep/717eb7ace3138f35e73771c70e44c80d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = input() | |
s = s + s | |
x = input() | |
if(x in s): | |
count = 0 | |
for i in range(len(x)): | |
if(x in s[i:i+len(x)]): | |
print(count, "rotation") | |
break | |
else: | |
count += 1 | |
else: | |
print("it is not a rotation") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment