Advertisement
a_yadvichuk

sdvig_strok

Apr 3rd, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. s=input()
  2. s1=input()
  3. step = int()
  4. if s==s1:
  5.     print(0)
  6. elif len(s) == len(s1):
  7.     while s!= s1 and step != len(s1):
  8.         step+=1
  9.         s = s[-1:]+s[:-1]
  10.     if step !=len(s):
  11.         print(step)
  12.     else:
  13.         print(-1)
  14. else:
  15.     print(-1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement