Buggy python submission (verdict: Time Limit Exceeded):
slist = input()
tlist = input()
scounter = 0
slength=len(slist)
for tchar in tlist:
    Sstart=scounter%slength
    while True:
        # print(tchar,slist[scounter%slength],scounter)
        if tchar == slist[scounter%slength]:
            scounter += 1
            break
        scounter += 1
        if scounter%slength==Sstart:
            scounter=-1
            break
    if scounter==-1:
        break
print(scounter)

Fixed submission:
slist = input()
tlist = input()
scounter = 0
slength=len(slist)
slist=slist+slist
preposition=-1
for tchar in tlist:
    preposition=slist.find(tchar, preposition+1)
    if preposition==-1:
        scounter=-1
        break
    elif preposition>=slength:
        scounter+=slength
        preposition-=slength
    # print(tchar, scounter, preposition)
if (scounter==-1):
    print(scounter)
else:
    print(scounter+preposition+1)

Buggy python submission (verdict: Time Limit Exceeded):
slist = input()
tlist = input()
# 番兵設定

scounter = 0
slength=len(slist)

for tchar in tlist:
    Slist=[]
    for schar in slist[scounter%slength:]:
        Slist.append(schar)
    for schar in slist[:scounter%slength]:
        Slist.append(schar)
    Slist.append("aa")
    for schar in Slist:
        # print(schar,tchar,scounter)
        if schar == "aa":
            scounter = -1
            tcharcheckflag=True
            break
        if tchar == schar:
            scounter += 1
            tcharcheckflag=True
            break
        scounter+=1
    if scounter == -1:
        break

print(scounter)

Fixed submission:
slist = input()
tlist = input()
scounter = 0
slength=len(slist)
slist=slist+slist
preposition=-1
for tchar in tlist:
    preposition=slist.find(tchar, preposition+1)
    if preposition==-1:
        scounter=-1
        break
    elif preposition>=slength:
        scounter+=slength
        preposition-=slength
    # print(tchar, scounter, preposition)
if (scounter==-1):
    print(scounter)
else:
    print(scounter+preposition+1)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()

slist = list(s)
tlist = list(t)
# 番兵設定

scounter = 0
slength=len(slist)

for tchar in tlist:
    Slist=[]
    for schar in slist[scounter%slength:]:
        Slist.append(schar)
    for schar in slist[:scounter%slength]:
        Slist.append(schar)
    Slist.append("aa")
    for schar in Slist:
        # print(schar,tchar,scounter)
        if schar == "aa":
            scounter = -1
            tcharcheckflag=True
            break
        if tchar == schar:
            scounter += 1
            tcharcheckflag=True
            break
        scounter+=1
    if scounter == -1:
        break

print(scounter)

Fixed submission:
slist = input()
tlist = input()
scounter = 0
slength=len(slist)
slist=slist+slist
preposition=-1
for tchar in tlist:
    preposition=slist.find(tchar, preposition+1)
    if preposition==-1:
        scounter=-1
        break
    elif preposition>=slength:
        scounter+=slength
        preposition-=slength
    # print(tchar, scounter, preposition)
if (scounter==-1):
    print(scounter)
else:
    print(scounter+preposition+1)

Buggy python submission (verdict: Runtime Error):
s=input()
t=input()

slist=list(s)
tlist=list(t)
#番兵設定
slist.append("aa")
scounter=0

for tchar in tlist:
  for schar in slist:
    #sを探してもない文字だった場合
    if schar =="aa":
      scounter=-1
      break
    if tchar==schar:
      break
    scounter+=1
    
  if scounter==-1:
    break
    
print(scounter)


while endflag==False:
  if 
  





Fixed submission:
slist = input()
tlist = input()
scounter = 0
slength=len(slist)
slist=slist+slist
preposition=-1
for tchar in tlist:
    preposition=slist.find(tchar, preposition+1)
    if preposition==-1:
        scounter=-1
        break
    elif preposition>=slength:
        scounter+=slength
        preposition-=slength
    # print(tchar, scounter, preposition)
if (scounter==-1):
    print(scounter)
else:
    print(scounter+preposition+1)