S1=input("")
S2=input("")
numR =0
temp=S1
no_match=False
n=len(S1)
while temp!=S2:
numR+=1
temp = S1[n - numR:] + S1[0 : n - numR]
if(numR>=n):
temp=S2
no_match=True
if no_match:
print("No Match")
else:
print(str(numR))
Comments
Leave a comment