def move(A):
temp = []
A = list(A)
temp.append(A.pop())
temp += A
return temp
def solution(A, B):
answer = 0
if A == B:
return 0
for i in range(len(B)):
answer += 1
temp = move(A)
if ''.join(temp) == B:
return answer
A = temp
else:
return -1
# 코드 줄임
def solution(A, B):
A, B = list(A), list(B)
for i in range(len(A)):
if A == B:
return i
temp = A.pop()
A.insert(0, temp)
return -1