Skip to content

Instantly share code, notes, and snippets.

@sakhayadeep
Created August 4, 2019 16:24
Show Gist options
  • Save sakhayadeep/717eb7ace3138f35e73771c70e44c80d to your computer and use it in GitHub Desktop.
Save sakhayadeep/717eb7ace3138f35e73771c70e44c80d to your computer and use it in GitHub Desktop.
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